I've used to process multiple rows data return by sql select statement, using vb or Java codes. As usual, it is just looping through the result set and process the data one record at a time.
Can people employ Stored Procedure alone to do row-level processing?
I did some research from the web but couldn't find a illustration how to use Stored procedure alone to accomplish the same task. Other web articles also point me to use VB, ASP, etc.
I did encounter one piece of code (from my workplace) that accomplishes it, but in somewhat weird way:
1) select the first record based on some criteria
2) process the record (for example: use the data to update other table)
3) change certain data of the record it processed so that it will not meet the same criteria in step 1.
4) loop back step 1
The above coding is wierd (in my opinion) because it requires multiple times access to the same table in step 1.. Can someone comment and enlighten me?
Can people employ Stored Procedure alone to do row-level processing?
I did some research from the web but couldn't find a illustration how to use Stored procedure alone to accomplish the same task. Other web articles also point me to use VB, ASP, etc.
I did encounter one piece of code (from my workplace) that accomplishes it, but in somewhat weird way:
1) select the first record based on some criteria
2) process the record (for example: use the data to update other table)
3) change certain data of the record it processed so that it will not meet the same criteria in step 1.
4) loop back step 1
The above coding is wierd (in my opinion) because it requires multiple times access to the same table in step 1.. Can someone comment and enlighten me?