View previous topic :: View next topic |
Author |
Message |
syam Beginner

Joined: 14 May 2006 Posts: 22 Topics: 7 Location: INDIA
|
Posted: Tue Dec 26, 2006 5:15 am Post subject: Dynamic sql select query |
|
|
Hi,
I want to use Dynamic Sql Select Query in a cobol , DB2, CICS program, Please let me know the process and compiler options and any other issues to be taken care of.I want a practical programmable solution
Thanks _________________ S Y A M
ONE CAN SMILE AND SMILE AND BE A VILLIAN |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
syam Beginner

Joined: 14 May 2006 Posts: 22 Topics: 7 Location: INDIA
|
Posted: Wed Dec 27, 2006 2:11 am Post subject: |
|
|
Kolusu,
Thanks for the info.After fetching the rows , the rows are moved into SQLDA, How to retrieve these values from SQLDA. _________________ S Y A M
ONE CAN SMILE AND SMILE AND BE A VILLIAN |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Dec 27, 2006 3:57 pm Post subject: |
|
|
Quote: |
After fetching the rows , the rows are moved into SQLDA, How to retrieve these values from SQLDA.
|
syam,
Where did you get that information? Did you even bother reading what it is in the above link?
Read the link once again
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
syam Beginner

Joined: 14 May 2006 Posts: 22 Topics: 7 Location: INDIA
|
Posted: Thu Dec 28, 2006 9:44 am Post subject: |
|
|
Kolusu,
Thank you now i got the things. Any how i made the design changes so that the progarm could accomadate for fixed list selct. I have browsed the ibm link http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/sqlp/rbafyfixed.htm . He gave the below example
MOVE 'SELECT EMPNO, LASTNAME FROM CORPDATA.EMPLOYEE WHERE EMPNO>?'
TO DSTRING.
EXEC SQL
PREPARE S2 FROM :DSTRING END-EXEC.
EXEC SQL
DECLARE C2 CURSOR FOR S2 END-EXEC.
EXEC SQL
OPEN C2 USING :EMP END-EXEC.
PERFORM FETCH-ROW UNTIL SQLCODE NOT=0.
EXEC SQL
CLOSE C2 END-EXEC.
STOP-RUN.
FETCH-ROW.
EXEC SQL
FETCH C2 INTO :EMP, :EMPNAME END-EXEC.
Now what should be the Picture clause of S2. Awaiting for a quick reply. _________________ S Y A M
ONE CAN SMILE AND SMILE AND BE A VILLIAN |
|
Back to top |
|
 |
syam Beginner

Joined: 14 May 2006 Posts: 22 Topics: 7 Location: INDIA
|
Posted: Thu Dec 28, 2006 10:17 am Post subject: |
|
|
Kolusu,
Execution is successful without declaring S2, Thank you very much for the efforts put up. _________________ S Y A M
ONE CAN SMILE AND SMILE AND BE A VILLIAN |
|
Back to top |
|
 |
|
|