Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Multiple updates w. static SQL vs. single dynamic SQL update

Re: Multiple updates w. static SQL vs. single dynamic SQL update

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 7 Jul 2006 17:16:04 -0800
Message-ID: <44aef944$1@news.victoria.tc.ca>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US