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 -> PL/SQL Update/Insert, Need Help

PL/SQL Update/Insert, Need Help

From: Tim Lindsey <timlind_at_hotmail.com>
Date: Tue, 4 Jan 2000 23:06:09 GMT
Message-ID: <Fnu2u9.7rr@news.boeing.com>

    I have a large master file I want to update with new data. The key fields are LC and ITEM.

    If there is a matching record in the new input file I want to update the ORDER and CUST fields.

    If there is no match I want to insert the new record.

    I assume I need to have both files indexed by the key fields. Does anybody know how I can do this? I am an experienced programmer but I'm new at writing PL/SQL.

Master File
SQLWKS> select * from ta_a;
LC ITEM ORDER CUST
--- --------------------------------

605 5555    A            LIGHT STRUCTURES
602 2222    A            MACHINING
603 3333    A            ASSEMBLY

New Input
SQLWKS> select * from ta_b;
LC ITEM ORDER CUST
--- --------------------------------

602 2222    B             FABRICATION
604 4444    A             SHIPPING

Updated Master File
SQLWKS> select * from ta_a;
LC ITEM ORDER CUST
--- --------------------------------

605 5555    A             LIGHT STRUCTURES
602 2222    B             FABRICATION       (record modified)
603 3333    A            ASSEMBLY
604 4444    A            SHIPPING                (record added)




Received on Tue Jan 04 2000 - 17:06:09 CST

Original text of this message

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