Re: using execute immediate for create table and then insert

From: Nigel Thomas <nigel.cl.thomas_at_googlemail.com>
Date: Mon, 2 Mar 2009 12:58:39 +0000
Message-ID: <53258cd50903020458q556939d6q272f1fe77bb69521_at_mail.gmail.com>



Another small thing; this may just be an artefact of the example, but you could simplify and improve by replacing the cursor FOR loop and nested insert with a simple insert:

insert into xxdl.xxdl_po_vendors_enc
(vendor_id, vendor_name, num_1099, num_1099_enc, attribute15)  select vendor_id

, vendor_name
, nvl(num_1099,'99-9999999')
, abs(dbms_crypto.RANDOMINTEGER)
, attribute15

 from po_vendors
where attribute15 is null

Thus avoiding the row-by-row fetch. Oh, and if it really needs to be dynamic, it's easier - because there are no bind variables to worry about.

Regards Nigel

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Mar 02 2009 - 06:58:39 CST

Original text of this message