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

Home -> Community -> Usenet -> c.d.o.server -> Re: Removing dublicate records in table and hostarray

Re: Removing dublicate records in table and hostarray

From: BobH <b-horton_at_worldnet.att.net>
Date: Thu, 23 Apr 1998 22:22:28 -0400
Message-ID: <6hot2q$bma@bgtnsc03.worldnet.att.net>


Brian Rasmusson wrote:
>
> Hi,
>
> I have a tricky problem that i would like to discuss.
>
> Imagine this scenario:
>
> Table X contains transactions, and may contain dublicates.
> Table Y contains the processed transactions, and no dublicates may
> exists. This is handled by having a primary key that the raw
> transactions does not have.
>
> Several machines deliver transactions to the master, placing them in
> table X. My application reads the transactions, and inserts them into
> the destination table Y after processing. If an insert of one
> transaction fail, i simply roll back.
>
> Now, i would like to optimize this. I now read 1000 transactions into a
> hostarray. I now want to do something like a FOR
> :number_of_records_in_hostarray delete from table Y where keycol1=:k1
> and keycol2=:k2 so i _know_ that i can insert the remaining records in
> one large bulk insert.
>
> Any suggestions on how to do this?
>
> Thanks in advance,
> 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
> ------------------------------------------------------------------------
Could you process your transactions from X, putting the records to be inserted into :host_array, omitting the dupes. Then from :host_array INSERT into Y.
Omitting the known dupes before hand will cutdown on Rollbacks due to Dupe PK and increase overall speed. Received on Thu Apr 23 1998 - 21:22:28 CDT

Original text of this message

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