Dynamic Cursor in Procedure [message #356197] |
Wed, 29 October 2008 22:57  |
bo_reno
Messages: 4 Registered: October 2008
|
Junior Member |
|
|
Hi,
I have a need to open a cursor in a stored procedure. The cursor will be populated with a select statement. I want to iterate through the rows and fix some of the fields in the set. Then, I want to pass the repaired cursor data set. Is this possible? Are the fields in the cursor updatable?
Thanks...
|
|
|
Re: Dynamic Cursor in Procedure [message #356260 is a reply to message #356197] |
Thu, 30 October 2008 01:49   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Do you want to change the data in the table, or just the fetched data?
If you only want to modify the fetched data, and leave the data in the table as it was, there are several options.
If your set is relatively small, you can use a plsql table (if you don't know what that is, search for PLSQL COLLECTIONS).
Another option might be to create a pipelined function.
|
|
|
|
Re: Dynamic Cursor in Procedure [message #356283 is a reply to message #356261] |
Thu, 30 October 2008 03:16   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Michel Cadot wrote on Thu, 30 October 2008 07:51 | And you should seriously investigate if you can't do it in a single UPDATE statement.
Regards
Michel
|
Or, if it's just the fetched data (so, no update is done at all), if you can't do the data-manipulation during the initial select.
If you can, you can return that as a REF CURSOR
|
|
|
|
|
|
|