If you use the keyword DO, then use END FOR at the end of the FOR loop. If you use the keyword LOOP, then use END LOOP at the end of the FOR loop.Examples Cursor-Based FOR Loops This example shows how to use a
Here are additional examples that use a RESULTSET: Use a RESULTSET-based FOR loop This example shows you how to use a FOR loop that iterates over a RESULTSET. Return a table for a cursor This example shows you how to use a cursor to return a table of data in a RESULTSET. ...
If for some reason, we want to return cursor* to the client, the order of the cursor elements may differ depending on the collation and the encoding of the sorted column(s). Note: A query with a presentation ORDER BY clause i.e. the one that is not coupled with the TOP clause, ret...