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: Question on referencing loaded columns in SQL Loader

Re: Question on referencing loaded columns in SQL Loader

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Wed, 20 Oct 1999 19:52:16 +0200
Message-ID: <940441957.2016.0.pluto.d4ee154e@news.demon.nl>


If you are using conventional load (ie not direct), you could easily take care of this with a trigger

create or replace trigger extra_col after insert on test_table for each row begin
:new.extracolumn := :new.column2;
end;
/

Hth,

--
Sybrand Bakker, Oracle DBA
Me <annardo_at_earthlink.net> wrote in message news:7ukkiq$5s9$1_at_birch.prod.itd.earthlink.net...
> I have a question on referencing previously loaded data in sql loader.
>
> e.g. I have a datafile with these data.
> "A1, "B1", "C1", "D1"
> "A2", "B2", "C2", "D2"
>
> I need to have a control file that would look something like:
> load data
> infile 'test.dat'
> replace
> into table test_table
> fields terminated by "," enclosed by '"'
> (
> column1,
> column2,
> column3,
> column4,
> extracolumn ":column2"
> )
>
> Is it possile for my fifth "extracolumn" reference the value in "column2"
> without SQL*loader thinking that there is an extra data field in the
> datafile? When I run the above, I'll get an error message stating that
> "Column not found before end of record...use TRAILING NULLCOLS". I don't
> want to use TRAILING NULLCOLS, because if I have a lot of fields, then
I'll
> get "Not all variables are bound."
>
> TIA
>
>
>
>
Received on Wed Oct 20 1999 - 12:52:16 CDT

Original text of this message

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