|
OK, I got *really* lucky when I happened on a post in the archive while searching for something unrelated to this original query. http://archive.midrange.com/rpg400-l/200402/msg00276.html is the link where Rob suggested checking the value of SQLERM right after the OPEN cursor SQL statement. Low & behold, I put a breakpoint right after the OPEN and viewed SQLERM; it appears that the cursor name appears in pos 3-20, the table name in pos 23-32 and the table's library name in pos 35-44. What's interesting and somewhat disappointing is that the message for SQLERR=7962 (SQL7962) reads only "Cursor &1 opened." and does not use the data for displaying the table name and library name, not even in the 2nd level text. Oh well, I guess since the data fields *are* defined in the msgd, I can probably count on it being there in the future. Gotta love the archives! Thanks Rob! - Dan On 7/14/05, Dan <dan27649@xxxxxxxxx> wrote: > Thanks for the suggestions. > > I inserted Rob's code right after the OPEN cursor SQL, and the result > in SchemaName was "*LIBL". I set a breakpoint and verified that the > file is indeed open via WRKJOB. Do I need to do this after the first > fetch? Just to clarify, I am looking for the library name for the > file I am querying. > > BTW, when researching this stuff in the iSeries SQL manuals, should I > completely forget about the native "library", "file", and "field" > terms, and use the SQL terms? > > Thanks, > Dan > > On 7/14/05, rob@xxxxxxxxx <rob@xxxxxxxxx> wrote: > > I wonder if > > D SchemaName S 128 Varying > > > > C/Exec SQL > > C+ VALUES CURRENT SCHEMA INTO :SchemaName > > C/End-Exec >
As an Amazon Associate we earn from qualifying purchases.
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.