Unix Technical Forum

Cursor with Hold

This is a discussion on Cursor with Hold within the DB2 forums, part of the Database Server Software category; --> Hi, Can I keep more than one cursor open in a program? I have Program A which calls program ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 05:39 PM
Purnendu
 
Posts: n/a
Default Cursor with Hold

Hi,

Can I keep more than one cursor open in a program? I have Program A
which calls program B. I may go into Program B to fetch data from 3
different cursors. I want to keep all these 3 cursors open during
execution of Program A. Whenever required I want to go into Program B
and fetch from corresponding open cursor.
Is there any other way to implement the same?

Thanks in advance
Purnendu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 05:39 PM
Douglas Doole
 
Posts: n/a
Default Re: Cursor with Hold

It depends on how your programs call each other.

If each program is a separate executable and your are invoking the
executable (say via the system() call) then you cannot do what you want
since DB2 manages connections on a per-process basis.

If the programs are linked into a single executable then you can do what you
want. If program A may do a COMMIT, then declare program B's with the WITH
HOLD option to keep the cursors open across transaction boundaries. Note
that if progam A does a ROLLBACK, then all cursors will be closed,
regardless of WITH HOLD.

Hope this helps.

--
__________________________________________________ ___________________
Doug Doole
DB2 Universal Database Development
IBM Toronto Lab

Visit the DB2 UDB and DB2 Connect Online Support site at:
http://www.ibm.com/software/data/db2...s2unix/support
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:11 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com