Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Multiple updates w. static SQL vs. single dynamic SQL update
max (cccp.forever_at_gmail.com) wrote:
: Hi,
: What would be better (faster):
: 1.have a stored procedure loop thru a list of values and execute a
: statement:
: 2. create a comma delimited string of values like so:
: list := value1 || ',' || value2 || ',' || value3....
: and using it in a dynamic SQL like so:
: v_sql = 'update customers
: set active = 1
: where customer_code in ( ' || list || ')'
How about 3.
insert the values to be selected into a global temporary table and then
update customers set active = 1 where customer_code in ( select selected_code from my_selection_table )Received on Fri Jul 07 2006 - 20:16:04 CDT