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: Hostarrays and UPDATE with missing records

Re: Hostarrays and UPDATE with missing records

From: <mpir_at_compuserve.com>
Date: 1998/03/02
Message-ID: <6df8a4$89v$1@nnrp1.dejanews.com>#1/1

In article <34FA8D53.8A076495_at_belle.dk>,   Brian Rasmusson <br_at_belle.dk> wrote:
>
> Hi,
>
> i'm in the process of optimizing some of our Oracle applications, but
> have run into a tricky situation.
>
> I have some code like this:
>
> UPDATE record
> IF UPDATE failed
> INSERT record
> END IF
>
> Can i achieve the same result using host arrays? I would like to try to
> UPDATE e.g. 100 records at a time, and have an indicator of which
> failed, and then INSERT those. I don't see anything about this in the
> manuals, so i guess it is not possible.
>
> Any other solutions than issuing the above code one time per record?
>
> Best regards,
> Brian
>
> ------------------------------------------------------------------------
> Brian Rasmusson, Software engineer & analyst e-mail: br_at_belle.dk
> Belle Systems A/S web : www.belle.dk
> Network, Internet and communication specialists phone : +45 59442500
> ------------------------------------------------------------------------
>

You can get close, if you are using SQLCA in a host language such as C. SQLCA is a structure that is the communications area. If an array insert fails, there is a field that identifies how may rows were processed. If an array insert fails on row 55 of 100, the field will say 54 (base 0 counting.)

I believe updates, by their nature, are done one row at a time for all rows in the set. Arrays can be inserted.

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Mon Mar 02 1998 - 00:00:00 CST

Original text of this message

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