sql *loader problem
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: sql *loader problem

  1. #1
    Join Date
    Oct 2000
    Posts
    211
    Hi friends,
    can some one help me with sql * loader problem?
    I have a flat file(data for 10 fields ) with data to be loaded into table A(10 fields). Before loading into table A, the 7th field's value from the datafile need to be mapped with Table B and corresponding value from that tableB needs to be replaced in flatfile and then loaded into tableA. So, after the loading, tableA will contain values 1 to 6 and 8 to 10 from the original flatfile and 7th value from tableB.
    Can someone help me with the stored procedure required to make it work?
    I am running 8.1.6 on tru64 5.0 compaq ES-40
    Thanks
    manjunath

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Why not do it with a trigger (I assume you are not using direct path option with loader)?

    CREATE OR REPLACE TRIGGER triggx ON tableA BEFORE INSERT FOR EACH ROW
    BEGIN
    SELECT <corresponding_value> INTO :NEW.col7 FROM tableB
    WHERE <condition with :OLD.col7>;
    END;

    HTH,
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Damn, this "less then/more than" characters have messed the previous message again. It should read like:

    CREATE OR REPLACE TRIGGER triggx ON tableA BEFORE INSERT FOR EACH ROW
    BEGIN
    SELECT corresponding_value INTO :NEW.col7 FROM tableB
    WHERE "condition with :OLD.col7";
    END;
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width