Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: storing Infile name into a column from SQL Loader
"Sybrand Bakker" <gooiditweg_at_sybrandb.verwijderdit.demon.nl> wrote in
message news:oeora05925o7lpmrq1fpnoap1oojprluv2_at_4ax.com...
| On 21 May 2004 02:23:39 -0700, rvenkat_at_gmail.com (R.Venkat) wrote:
|
| >Hi,
| > i have a requirement that i need to load data of the same format
| >from different datafiles. now to distinguish between these records,i
| >need to put the infile name also into a column named FILENAME in the
| >target table. how do i do that?
| >Thanks,
| >~Venkat
|
| Use sed or any other stream editor to add the filename as a separate
| column to all individual records, prior to loading the file.
| Or load the files in individual tables, one per file and merge them
| afterwards.
| Sql*loader can't do this.
|
|
| --
| Sybrand Bakker, Senior Oracle DBA
set up the datafiles as four different external tables -- when you insert the rows from each external table into the target table, include a value for the original filename
if you get real clever, you can probably script this so that it can be done automatically and dynamically with any filename that needs to be loaded into the table