Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Loading external data without specifying column names
Chrean wrote:
> Hello folks,
> I'd need to do exactly what I wrote in subject.
> Starting from a set of txt files, each containing data to be loaded in
> my oracle db's tables, I have to write a script that loops on each file
> and load it into the db.
> I tried with sqlldr, but it requires that I specify every column name.
> I don't want to do that, 'cause my routine will always find a match
> between db columns and datafiles fields.
>
> Correct syntax is:
>
> load data
> infile 'example.dat' "fix 11"
> into table example
> fields terminated by ',' optionally enclosed by '"'
> (col1, col2)
>
> while I'd want something like this:
>
> load data
> infile 'example.dat' "fix 11"
> into table example
> fields terminated by ',' optionally enclosed by '"'
>
> 'cause I already know my table will have 2 columns (and my datafile
> will always have 2 fields, of course), not necessarily named "col1",
> "col2".
>
> Thanks in advance,
> Chrean
Oracle is a *database*, NOT a GARBAGE BIN. Databases are *DESIGNED*!!!
-- Sybrand Bakker Senior Oracle DBAReceived on Tue Nov 14 2006 - 12:24:53 CST