Home » RDBMS Server » Server Utilities » sql loader question
sql loader question [message #139535] Wed, 28 September 2005 09:55 Go to next message
sledge
Messages: 3
Registered: August 2005
Junior Member
Hi all,

I want to populate to table in one go:

INFILE "pADaten1"
APPEND INTO TABLE ADRESSE
fields terminated by ']' optionally enclosed by '|'
TRAILING NULLCOLS
(
person_id,
plz,
ort,
strasse,
version constant '1',
nummer constant '1',
gesperrt constant '0',
gueltigvon "sysdate",
id "loader_seq.nextval"
)

INTO TABLE ADRESSROLLE
TRAILING NULLCOLS
(
person_id ":person_id",--<== this does not work
id "loader_adr_seq.nextval",
version constant '1',
adresstyp_id constant '100',
adresse_id "loader_seq.currval"

)

The problem is that i want to use ther person_id from adresse in adressrolle again. Any idea on how to achieve that?

Thanks a lot,

Alex
Re: sql loader question [message #139988 is a reply to message #139535] Fri, 30 September 2005 07:37 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member

Just for a try ,

can you specify the position of person_id from the data file.
something like this

 person_id POSITION(1:2) INTEGER EXTERNAL(3) 



I copied the code from the samples provided by Oracle itself and even you can find them on your machine at location $ORACLE_HOME\rdbms\demo , named as ulcase1, ulcase2 .. etc.

hope it might helps you.
regards,
tarun
Re: sql loader question [message #140028 is a reply to message #139988] Fri, 30 September 2005 09:18 Go to previous messageGo to next message
sledge
Messages: 3
Registered: August 2005
Junior Member
it seems it works with fixed length records - which I do not have. I haven't tried as my data will not be in this format.
the problem is the reuse of :pers_id, it is probably out of scope as soon as i update another table.
It might be that I need to skip the idea of using sqlloader altogether and write some real nasty PL/SQL instead ...

Cheers,

Sledge
Re: sql loader question [message #140099 is a reply to message #139535] Fri, 30 September 2005 16:43 Go to previous message
Barbara Boehmer
Messages: 9097
Registered: November 2002
Location: California, USA
Senior Member
You could use a before insert row trigger on your adresse table to automatically populate your adressrolle table.
Previous Topic: export crisis..!!!
Next Topic: IMP Problem
Goto Forum:
  


Current Time: Tue Jul 02 22:07:53 CDT 2024