Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8894

In stored proc, inner cursor needs variable from outer cursor

$
0
0

I recently came over to Sybase ASE SQL from Microsoft SQL Server.  In SQL Server I would often create stored procedures with a nested cursor in which the SELECT statement for the inner cursor contains a WHERE clause with a variable fetched by the outer cursor.  I know that in Sybase the DECLARE CURSOR statement needs to be in a separate batch, so I’m not sure how this can be done.  Any ideas? Thanks.

 

P. S. I know that cursors aren't ideal but in some situations they're a good solution.


Viewing all articles
Browse latest Browse all 8894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>