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 -> Multiple updates w. static SQL vs. single dynamic SQL update

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

From: max <cccp.forever_at_gmail.com>
Date: 7 Jul 2006 15:07:33 -0700
Message-ID: <1152310053.924089.235910@m73g2000cwd.googlegroups.com>


Hi,

What would be better (faster):

1.have a stored procedure loop thru a list of values and execute a statement:

           update customers
                set active = 1
            where customer_code = value

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 || ')'

Thanks. Received on Fri Jul 07 2006 - 17:07:33 CDT

Original text of this message

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