Hi,
I've always used SQL-Loader for loading external files on Oracle.
Every flat files has got fields terminated by ";" but in the same file I've got a different format depending on the first value.
For example myfile.dat is:
...
A;John;Brown
A;Maty;Green
B;car;red;ford
...
By using SQL-Loader I can use two distinct *.CTL as following:
LOAD DATA
INFILE ... myfile.dat
BADFILE ...
APPEND
INTO TABLE TABLE_1 WHEN type_record = 'A'
FIELDS TERMINATED BY ';'
TRAILING NULLCOLS
(type_record,
name,
sirname)
LOAD DATA
INFILE ... myfile.dat
BADFILE ...
APPEND
INTO TABLE TABLE_2 WHEN type_record = 'B'
FIELDS TERMINATED BY ';'
TRAILING NULLCOLS
(type_record,
vehicle,
colour,
brand)
Can I do such a thing by using external tables or in this case all the records of the myfile.dat must have the same format? I need to load into different tables depending on the fist value that is the type_record
Oracle version 10g
Thanks in advance!
Mark