Re: Array fetch using cursor
Posted in 1998
Art, I think the original poster maybe was alluding to array fetches, ala Oracle, where you can fetch myltiple records using a single fetch, such as: EXEC SQL FOR :array_size FETCH mycurs INTO :array_for_field1, :array_for_field2; This really speeds up things up when you need to scan a large table. I don't know if you can use descriptors or not, but the arrays are also supported for insert and update statements. Correct me if I'm wrong, but I don't think Informix supports this with fetches. The PUT statement maybe emulate some of this for inserts/updates, but you still need a call to the DB library for each record, yes? -Peter Art S. Kagel wrote: > Peter Lancashire wrote: > > > > venugopal gangadharan wrote: > > > > > > Hi, > > > Hi , > > > I want to know how an array fetch can be done from a table in an > > > Informix DB using a cursor > > > > > > My Problem:- > > > total records in the table :- 120000 > > > Processing done :- > > > fetch records one at a time and write into a binaryfile > > > TimeTaken :- > > > around 14 mins > > > > > > > > > > > > can any one help me on this , > > > IS there any other way to tune up the fetch > > > > > > thankyou > > > > > > Venu. > > > > > > ______________________________________________________ > > > Get Your Private, Free Email at http://www.hotmail.com > > > > I think you can increase the buffer size used by cursors in ESQL/C. My > > memory is unreliable (loose connections) so please check. > > Check out the Array Fetch code in my dbcopy.ec utility in utils2_ak in > the IIUG Software Repository for a sample code. Dbcopy uses increased > buffer size along with the Fetch Array feature to run 3X faster than > the original version. Disabling Fetch Array and only using the > increased buffer size (command line parameters) improves performance > about 20% over disabling both. > > Art S. Kagel