View previous topic :: View next topic
|
Author |
Message |
kashyani
New User
Joined: 11 Apr 2007 Posts: 5 Location: mumbai
|
|
|
|
Hi.
I have cont-id field in my file as 12345
in my table thid id is like 12345A,12345B,12345C
i HAVE TO FETCH ALL THESE RECORDS FROM THE TABLE.
I want to use cursor for that.
What could be the cursor declaration? |
|
Back to top |
|
|
balanim
New User
Joined: 29 Nov 2006 Posts: 6 Location: India
|
|
|
|
you can use simple cursor declaration.
declare a host variable
DCL HOSTV char(4) init(1234);
then declare a cursor.
EXEC SQL DECLARE CURLIKE CURSOR FOR
SELECT FROM tablename
WHERE CONT-ID LIKE :HOSTV
FOR FETCH ONLY;
This example is for PL/I if you want for cobol change accordingly.
Hope this helps
Cheers
Bnim |
|
Back to top |
|
|
|