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: Update multiple rows

Re: Update multiple rows

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sun, 28 Mar 2004 17:57:10 -0800
Message-ID: <1080525408.5408@yasure>


xhat wrote:

> Ok, I'm still pretty wet behind the ears in relation to Oracle, so I'm
> going to need a bit of leading by the nose.
>
> I've created an associate array of data values using PHP that I need
> to write into an update statement for a table. Call it table A. I
> could make approximately 1,000+ calls (my array is 1042 results) to a
> single row update statement, but that strikes me as wildly
> inefficient. Is there a better way to do this? Can one long SQL
> statement be written that will accomplish the same thing?
>
> Like I said, you'll have to talk slowly to me and use lots of
> pictures. I'm freshly baptised in Oracle and PL/SQL. Thanks in
> advance.

Two methods ...

  1. Pass the array
  2. Bundle the insert statements such that the string passed in looks like this:

    BEGIN
    INSERT INTO ...
    INSERT INTO ...
    ...
    END;
    /

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sun Mar 28 2004 - 19:57:10 CST

Original text of this message

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