Skip to main content

This might be a simple question...

I declare a cursor for: 

SELECT TOP 10 * FROM tablename

but, there is only 1 row in tablename and I am fetching until SQLCODE = 100

Does the FETCH reach 100 after 1 row or does it keep processing until all 10 have been fetched?

 

This might be a simple question...

I declare a cursor for: 

SELECT TOP 10 * FROM tablename

but, there is only 1 row in tablename and I am fetching until SQLCODE = 100

Does the FETCH reach 100 after 1 row or does it keep processing until all 10 have been fetched?

 

Hello Bart,

Can you show the code lines once?

What SQL database is it?

ODBC / Precompiler?

Best Regards
Bernd

This might be a simple question...

I declare a cursor for: 

SELECT TOP 10 * FROM tablename

but, there is only 1 row in tablename and I am fetching until SQLCODE = 100

Does the FETCH reach 100 after 1 row or does it keep processing until all 10 have been fetched?

 

As soon as there are no more rows to fetch it should return the 100 SQLCODE. Since there is only one row available the second fetch will return 100.