bind



IBM's flagship relational database management system

bind

Postby vaishalisingh » Mon Aug 24, 2009 1:42 pm

what would happen if the timestamps are not placed while db2-cobol program compilation ? and why does the precomplier places host language calls while exxtracting SQL statements from Cobol Db2 program
vaishalisingh
 
Posts: 5
Joined: Mon Aug 24, 2009 1:37 pm
Has thanked: 0 time
Been thanked: 0 time

Re: bind

 

Re: bind

Postby dick scherrer » Mon Aug 24, 2009 11:50 pm

Hello,

what would happen if the timestamps are not placed while db2-cobol program compilation ?
The timestamps are critical. . . There is no way to compile/bind without them. . . Possibly i misunderstand what you are asking.

and why does the precomplier places host language calls while exxtracting SQL statements from Cobol Db2 program
Because that is the way it is designed. . . Again, possibly i misunderstand . . .

You might talk with some of your co-workers and provide a more clear description of what you are looking for. When we understand this, we should be able to post more useful replies.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: bind

Postby GuyC » Tue Aug 25, 2009 1:24 pm

I'll give it a go :

A cobol compiler can't (couldn't) compile SQL : that is not its job. so you need to DB2 precompile.
The precompiler changes the SQL into something that the cobol compiler understands : CALL

Another output of the precompiler is the DBRM = the info that the precompiler got from the SQL-statements.
Think of it as a subroutine that does something like this (very very simplified):

procedure division using stmtno, var1, var2 ,var3,...

Evaluate stmtno
when 1 then perform the-first-SQL
when 2 then perform the-second-SQL
...
end-evaluate
.
the-first-sql.
move var1 to key-field-tab1
read vsam1
move col3 to keyfiedl-tab2
read vsam2
move column3 to var3
.


the part in the paragraph the-frst-sql is "The accesspath".

To make sure that "the-first-sql-statement" in your cobol program is the same as what is in the DBRM, DB2 chose to use a standard solution : The caller gives a timestamp (actually a version or contoken) and the callee (is that a word ?) checks if that contoken matches with what it has in its own Working-storage.
I can explain it to you, but i can not understand it for you.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: bind

Postby vaishalisingh » Tue Aug 25, 2009 5:42 pm

Thanks for the reply.. i got it this time.
vaishalisingh
 
Posts: 5
Joined: Mon Aug 24, 2009 1:37 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post