Re: SQLLDR and select in .ctl -file

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 29 Aug 2001 12:34:09 +0200
Message-ID: <tophhk7iotic1c_at_news.demon.nl>


"Major" <lievonen_at_jyu.fi.HALOOOOOOOO> wrote in message news:fr3j7.166$3h3.7647_at_read2.inet.fi...
> Problem is that I must make select in control file:
>
> load data
> infile 'rate2.txt'
> append
> into table rate_test
> trailing nullcols
> (security_id position (4:18)
> "(SELECT SECURITY_ID FROM SECURITY_TEST WHERE AB_ID=:security_id)",
> rate_date position (20:29) date "yyyy-mm-dd",
> close position (120:137)
> )
>
> Firstest row go OK. But next rows have same "SECURITY_ID" values than
> firstest row,
> so SQL query will not updated in every row (in source file field
> "security_id" is different,
> and it will found from SECURITY_TEST -table).
>
> Query will update after error,
> so if I make bull shit rows after "valid" row, valid row will go to
database
> OK.
>
> I made tar to Metalink but they cannot help me.
>
> Latest hope is that I replase "/n" with "/n bull shit row/n" but I have
over
> ten million rows in
> ten different files :-(
>
> Could You help me?
>
> Regads Major
>
>

Wouldn't a before insert for each row trigger on that table resolve your problem?
create or replace trigger rate_test_bir before insert on rate_test for each row
begin
select security_id
into :new.security_id
from security_test
where security_id = :new.security_id;
end;

Your last remark is -sorry to say so- because of your English incomprehensible.

Hth,

Sybrand Bakker, Senior Oracle DBA Received on Wed Aug 29 2001 - 12:34:09 CEST

Original text of this message