× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have a file which I read through embedded SQL, I fetch all records and
end-of-file (SQLCOD=100) condition is found. Now, due to some reason again I
want to fetch records from top of the file. I can do it by closing the
opened cursor and re-declaring and re-opening the cursor again, but can I
achieve it without closing and reopen the cursor? Herewith sample of my
program coding. Please help me. Regard.
 
 
/EXEC SQL
DECLARE C1 CURSOR FOR SELECT field1,field2
FROM filename 
/END SQL
 
/EXEC SQL
OPEN C1
/END SQL
STRC1         TAG
/EXEC SQL                      
 FETCH C1 INTO :xfield1, :xfield2
/END SQL
 
SQLCOD        IFEQ      100
GOTO      CLSC1
ENDIF          
.
.
.
GOTO STRC1
 
/EXEC SQL 
 CLOSE C1
/END-EXEC
 
Amir Raza Khan
EDP, Dammam,
Ext - 267
 

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.