Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cursor -> Table or Cursor -> Local Variable -> Table?

Status
Not open for further replies.

Petemush

Technical User
Jun 21, 2002
255
GB
Hello, once again rather than giving a proper problem I've got one about performance/security.

If I'm selecting a number or columns using a cursor and then wish to pass those column values, as well as other values, into a table(well, table encapsulation package), should I call the procedure using the cursor.col_name syntax or should I put the cursor values into variables first and then call the procedure using the variables.

I.e.

table_input_procedure(cursor.col_1, cursor.col_2, other_value, cursor.col_3);

OR

lc_variable_1 := cursor.col_1;
lc_variable_2 := cursor.col_2;
other_value := something_else;
ln_variable_3 := cursor.col_3;

table_input_procedure(lc_variable_1, lc_variable_2, other_value, ln_variable_3);



Cheers,

Pete
 
Cursor doesn't hold any value. Don't you mix it up with some variable of type record that you've fetched your cursor into? If so, it doesn't matte; creating local variables may be redundant, but in some cases may be usefull for debugging (not all kinds of debuggers are capable to show complex types)

Regards, Dima
 
Yeah sorry, didn't write that very well.
It should have had something like

cursor real_cursor%ROWTYPE

OPEN real_cursor;
FETCH real_cursor INTO cursor
CLOSE real_cursor

before all of that.

Cheers for your answer though. Will probably keep variables for debugging purposes.

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top