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

Home -> Community -> Usenet -> comp.databases.oracle -> Re: Array selection and update.

Re: Array selection and update.

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Fri, 30 Apr 2004 00:09:52 GMT
Message-ID: <kPgkc.146$AV4.5531@attbi_s04>

"Mark A Framness" <farmer_at_netnet.net> wrote in message news:8168768c.0404291411.31ac17f2_at_posting.google.com...
> Greetings,
>
> I am working on a project and we need to write a conversion script to
> initialize a new field on a table. The number of records on this table
> is on the order of millions so routine selection and update takes a
> long time.
>
> I am tasked with writing a pl/sql proc that utilizes array processing
> to update the column.
>
> Since all of the fields I am going to update are null, does it pay to
> create a array-based select prior to updating? I was thinking of
> array-selecting and then array updating 5000 at a crack. Or should I
> just write a single update statement? Does the former approach (think
> F-former F-first) perhaps give us the ability to commit where the
> later (l-later l-last) does not?
>
> What I have tried to do is bulk select the key fields into appropriate
> arrays, I then bind those arrays to the update fields. Then I call the
> update statement. These steps are performed in a while loop until the
> number of records retrieved is less than the the max number to
> fetch/pass.
>
> If you have a small little example of what I am trying to do, please
> post it.
>
> Thank You
> }\/{ark

Why not
update mytable set myField=WhateverYouWantTheFieldToBe; commit;
That will be fastest.
Jim Received on Thu Apr 29 2004 - 19:09:52 CDT

Original text of this message

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