× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Problems with ODP in SQL cursor
  • From: Patrick Fleming <patrickf@xxxxxxxxxxx>
  • Date: Mon, 3 Nov 1997 10:49:53 +1100

Hi

I have a problem which I just discovered, where an open data path is being 
reused by a SELECT clause, even though the SELECT clause is different prom the 
clause that created the ODP. Why did it reuse the ODP, and how can I specify 
that the ODP gets rebuilt each time I open the cursor.

I have written an ILE RPG program on our V3R7 AS/400 that contains a PREPARE 
the cursor, DECLARE , OPEN CURSOR and CLOSE CURSOR. This program is called in a 
loop from another program and is passed a region code. The region code is 
concatenated to a string containing a "SELECT field1, field2, field3..... WHERE 
xxxxxx GROUP BY field1, field2, field3"

The program runs interactively, reading the file which is overriden into QTEMP. 
The joblog tells me after the PREPARE that the ODP was reused, and doesn't 
rerun the SQL SELECT clause I just built, but reuses the SQL from the first 
invocation. I am setting on LR at the end of the program before returning to 
the previous program to get the next region code.

My question is, how do I get DB2 not to reuse the old query, but to rebuild the 
query each time I open the cursor (i.e. each time the program is invoked from 
its calling program).  I have other programs using the PREPARE  etc. and they 
work ok (though they are not called by anything).

Please help 

TIA

Patrick Fleming
(patrickf@real.com.au)
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MAJORDOMO@midrange.com
|    and specify 'unsubscribe MIDRANGE-L' in the body of your message.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.