View previous topic :: View next topic |
Author |
Message |
ranga_subham Intermediate

Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Mon Jun 12, 2006 3:13 am Post subject: Call statements for each SQL query!? |
|
|
Hi,
I am very sorry if this is very basic question.
I have a COBOL-DB2 program with embedded SQL statements.
SELECT EMP-NAME, EMP-AGE
FROM EMPTABL
WHERE EMP-LAST-NAME = 'KOLUSU';
SELECT EMP-NAME, EMP-GENDER
FROM EMPTABL
WHERE EMP-GENDER = 'F';
SELECT EMP-DOB, EMP-ADDR
FROM EMPTABL
WHERE EMP-FRST-NAME = 'KOLUSU';
Now, I would like to know how the COBOL converts them to the equivalent CALL statements of each.
Please explain in detail.
Thanks in advance. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Mon Jun 12, 2006 3:25 am Post subject: |
|
|
ranga_subham,
After you pre-compile a COBOL-DB2 program , check for the compile listing in the spool and you wil be able to see the SQL statements being converted to equivalent CALL statements.
A sample of conversion would be below.Similarly check in the spool the entire conversion of SQL statements.
Code: | *****EXEC SQL
***** FETCH SELECT-CURSOR
***** INTO :EMPNO, :FIRSTNAME, :MIDINIT,
***** :LASTNAME, :GENDER, :BIRTHDATE
*****END-EXEC.
PERFORM SQL-INITIAL UNTIL SQL-INIT-DONE
CALL "DSNHLI" USING SQL-PLIST3.
|
_________________ Shekar
Grow Technically |
|
Back to top |
|
 |
ranga_subham Intermediate

Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Mon Jun 12, 2006 4:55 am Post subject: |
|
|
Thanks Shekar. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
 |
|
|