Save 
Join IIUG
 for   
 

Informix News
13 Jan 12 - MC Press online - Informix Dynamic Server Entices New Users with Free Production Edition ... Read
11 Jan 12 - Computerworld - Ecologic Analytics and Landis+Gyr -- Suitors Decide to Tie the Knot... Read
9 Jan 12 - planetIDS.com - DNS impact on Informix / Impacto do DNS no Informix... Read
8 Sep 11 - TMCnet.com - IBM Offers Database Solution to Enable Smart Meter Data Capture... Read
1 Aug 11 - IBM Data Management Magazine - IIUG user view: Happy 10th anniversary to IBM and Informix... Read
8 Jul 11 - Database Trends and Applications - Managing Time Series Data with Informix... Read
31 May 11 - Smart Grid - The meter data management pitfall utilities are overlooking... Read
27 May 11 - IBM Data Management Magazine - IIUG user view: Big data, big time ( Series data, warehouse acceleration, and 4GLs )... Read
16 May 11 - Business Wire - HiT Software Announces DBMoto for Enterprise Integration, Adds Informix. Log-based Change Data Capture... Read
21 Mar 11 - Yahoo! Finance - IBM and Cable&Wireless Worldwide Announce UK Smart Energy Cloud... Read
14 Mar 11 - MarketWatch - Fuzzy Logix and IBM Unveil In-Database Analytics for IBM Informix... Read
11 Mar 11 - InvestorPlace - It's Time to Give IBM Props: How many tech stocks are up 53% since the dot-com boom?... Read
9 Mar 11 - DBTA - Database Administration and the Goal of Diminishing Downtime... Read
2 Feb 11 - DBTAs - Informix 11.7 Flexible Grid Provides a Different Way of Looking at Database Servers... Read
27 Jan 11 - exactsolutions - Exact to Add Informix Support to Database Replay, SQL Monitoring Solutions... Read
25 Jan 11 - PR Newswire - Bank of China in the UK Works With IBM to Become a Smarter, Greener Bank... Read
12 Oct 10 - Database Trends and Applications - Informix 11.7: The Beginning of the Next Decade of IBM Informix... Read
20 Sep 10 - planetIDS.com - ITG analyst paper: Cost/Benefit case for IBM Informix as compared to Microsoft SQL Server... Read
20 Jul 10 - IBM Announcements - IBM Informix Choice Edition V11.50 helps deploy low-cost scalable and reliable solutions for Apple Macintosh and Microsoft Windows... Read
20 Jul 10 - IBM Announcements - Software withdrawal: Elite Support for Informix Ultimate-C Edition... Read
24 May 10 - eWeek Europe - IBM Supplies Database Tech For EU Smart Grid... Read
23 May 10 - SiliconIndia - IBM's smart metering system allows wise use of energy... Read
21 May 10 - CNET - IBM to help people monitor energy use... Read
20 May 10 - ebiz - IBM Teams With Hildebrand To Bring Smart Metering To Homes Across Britain... Read
19 May 10 - The New Blog Times - Misurare il consumo energetico: DEHEMS è pronto... Read
19 May 10 - ZDNet - IBM software in your home? Pact enables five-city smart meter pilot in Europe... Read
17 March 10 - ZDNet (blog) David Morgenstern - TCO: New research finds Macs in the enterprise easier, cheaper to manage than... Read
17 March 2010 - Virtualization Review - ...key components of Big Blue's platform to the commercial cloud such as its WebSphere suite of application ser vers and its DB2 and Informix databases... Read
10 February 2010 - The Wall Street Journal - International Business Machines is expanding an initiative to win over students and professors on its products. How do they lure the college crowd?... Read


End of Support Dates

IIUG on Facebook IIUG on Twitter


[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Development Tools Forum

Re: Refreshing updated row fetched by a scroll cur

Posted By: Art Kagel
Date: Friday, 2 July 2010, at 7:43 a.m.

In Response To: Refreshing updated row fetched by a scroll cursor (RAVI PASUPULETI)

That's because a SCROLL CURSOR actually creates a temp table with the query
results and returns data from the temp table which has not been updated.
The temp table is needed to be able to implement the FETCH FIRST, LAST, NEXT
and PREVIOUS features of a SCROLL CURSOR. But you don't need a SCROLL
CURSOR to implement this logic, especially since 7.31/9.30 implemented the
FIRST and SKIP options to the SELECT statement. Just a bit of programming.

If you want to see updated data on the display, I would fetch a block of
data from a non-scrolling CURSOR into an array and display rows from that
array instead. Then when the user updates the rows in the array, you will
have the updated data to redisplay as the user scrolls around. You can use
a sliding window of data where the array holds say 100 rows. As long as the
user is scrolling within those 100 rows you are good. If the user wants to
scroll outside of the array, say to the 101st row, move the 51st through
100th rows to the beginning of the array and fetch the next 50 from the
cursor to the end of the array. If the user later scrolls back past row 50
to row 49 or lower, slide rows 50-100 back up the array and close and reopen
the cursor to replace the first 50 rows in the array. You can use FIRST and
SKIP to manage the number and subset of rows in the select set that are
returned by the cursor. Your data will always be up-to-date because you
will either be displaying the modified row from your array or after
scrolling around a refetched updated version of the row from the database.
Just make sure that your SELECT statement has an ORDER BY clause so that the
returned result sets are consistently ordered whenever you close and reopen
the cursor. Remember that the SQL standard permits the optimizer to return
data in any order it finds it without an ORDER BY clause and the optimizer
can change the query plan, especially if there are replaceable parameters in
the query, between executions.

I've written many apps like this over the years and it is a very good
technique and very easy to implement if you set up the array management data
structures properly and modularize the code to slide and populate the
array. A colleague dubbed the technique "The Electric Slide" once after I'd
written one of the beasties when that dance was popular - way back. ;-)

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)

Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.

On Fri, Jul 2, 2010 at 5:24 AM, RAVI PASUPULETI <rpasupul@gmail.com> wrote:

> Hi,
> I opened a 'SCROLL CURSOR', fetching the rows one by one and displaying one
> at
> a time on a screen. When I update a row, save it, move to the next row and
> come back I would like to see the changes made. The fetch is not getting
> the
> updated row but the old information. How can I see the actual current db
> values on the screen ?
> Thank you,
> RKP
>
>
>
> *******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>

--0016361644c9e4674f048a6616c8

Messages In This Thread

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Development Tools Forum is maintained by Administrator with WebBBS 5.12.