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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| ||||
| 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 |