Page 1 of 1

How to identify table names from within COBOL code via SQL ?

PostPosted: Wed Oct 27, 2010 6:14 pm
by Tecno
Hi,

I have a program wich accesses many tables, and would like to know if there is anything similar, to the SQLCA - SQL Communications Area, that I can declare and use in the COBOL program, but with information about the last table accessed by an SQL instruction? That could provide me with the name of the table.

Thanks for the help !

Re: How to identify table names from within COBOL code via SQL ?

PostPosted: Wed Oct 27, 2010 6:35 pm
by NicC
How about just putting the table name into a variable just as you are about to execute the query?

Re: How to identify table names from within COBOL code via SQL ?

PostPosted: Wed Oct 27, 2010 6:43 pm
by Tecno
NicC wrote:How about just putting the table name into a variable just as you are about to execute the query?


It works sure, but it's not what I'm looking for ;) I really want to know if db2 sql keeps that info somewhere...

Thanks for the help anyway :)

Re: How to identify table names from within COBOL code via SQL ?

PostPosted: Wed Oct 27, 2010 6:49 pm
by NicC
Well, then. Post in the DB2 section not the COBOL section.

Re: How to identify table names from within COBOL code via SQL ?

PostPosted: Wed Oct 27, 2010 7:05 pm
by Tecno
NicC wrote:Well, then. Post in the DB2 section not the COBOL section.


I want to know how to do it, via SQL, like SQLCA, but not... But from within the COBOL source code of the program, so I posted it here.

Thanks

Re: How to identify table names from within COBOL code via SQL ?

PostPosted: Wed Oct 27, 2010 9:00 pm
by NicC
Well, I gave you a COBOL answer but you say you want a DB2 answer - maybe accessed using COBOL but that is a by-the-bye as it could be accessed by any language that has an interface to DB2. You want to know if DB2 keeps such a thing - probably not - but if it did the answer is a DB2 answer so it is more relevant to that section so that anyone wanting that information, but using a different language, should be able to find it.

Re: How to identify table names from within COBOL code via SQL ?

PostPosted: Wed Oct 27, 2010 11:26 pm
by Tecno
NicC wrote:Well, I gave you a COBOL answer but you say you want a DB2 answer - maybe accessed using COBOL but that is a by-the-bye as it could be accessed by any language that has an interface to DB2. You want to know if DB2 keeps such a thing - probably not - but if it did the answer is a DB2 answer so it is more relevant to that section so that anyone wanting that information, but using a different language, should be able to find it.


Thanks for the help ! :)

Re: How to identify table names from within COBOL code via SQL ?

PostPosted: Thu Oct 28, 2010 1:30 am
by dick scherrer
bump. . .