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



IBM's flagship relational database management system

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

Postby Tecno » Wed Oct 27, 2010 6:14 pm

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 !
Tecno
 
Posts: 9
Joined: Thu Oct 14, 2010 3:50 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby NicC » Wed Oct 27, 2010 6:35 pm

How about just putting the table name into a variable just as you are about to execute the query?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

Postby Tecno » Wed Oct 27, 2010 6:43 pm

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 :)
Tecno
 
Posts: 9
Joined: Thu Oct 14, 2010 3:50 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby NicC » Wed Oct 27, 2010 6:49 pm

Well, then. Post in the DB2 section not the COBOL section.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

Postby Tecno » Wed Oct 27, 2010 7:05 pm

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
Tecno
 
Posts: 9
Joined: Thu Oct 14, 2010 3:50 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby NicC » Wed Oct 27, 2010 9:00 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

Postby Tecno » Wed Oct 27, 2010 11:26 pm

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 ! :)
Tecno
 
Posts: 9
Joined: Thu Oct 14, 2010 3:50 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Thu Oct 28, 2010 1:30 am

bump. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post