January 6, 2010 at 8:45 am
I have not used SQL Cursors so far.
I need help with script to read rows from a temporary table using cursors.
Please help.
Thanks very much.
January 6, 2010 at 8:48 am
Before talking about how to write a cursor we should talk about what you'd like to do. In most cases a cursor can (and should) be avoided.
January 6, 2010 at 8:52 am
I want to use CURSOR, which will be scanning the temporary table.
So with cursor you will be reading the temporary table row by row. Then I have to compare TypeID of the current row with TypeID of the previous row and accumulate unavailability time as I advance through the table.
I know there are other ways of doing it, but due to the requirement it has to be done using CURSORS.
January 6, 2010 at 8:58 am
Sql_query (1/6/2010)
I know there are other ways of doing it, but due to the requirement it has to be done using CURSORS.
You've just aroused my curiosity. What is the requirement that says you have to use cursors???
+--------------------------------------------------------------------------------------+
Check out my blog at https://pianorayk.wordpress.com/
January 6, 2010 at 8:59 am
Sounds like test or homework...
I can't think of a valid business rule to refuse good performing code...
Sorry, but I can't help here!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply