SQL*Loader and CSV file


Question:

Does anyone know how to specify the rows you want imported into a table?
For example, i have a CSV file of 10 fields and a table with 5 fields.  I
want to specify which fields i want from the CSV into the table.



Ans:

This problem over SQL*Loader solve a hard
Optimal - uses UTL_FILE packages (if you have Oracle 7.3 and later)

You can read first record in CSV datafile
Analyze and fill tempory table of next record values

Over SQL*Loader
You must create two CTL file - first for detecting column name

desc scott.loadcolname
  ID number(10)
  Collumn_Name varchar2(50)

desc scott.loaddata
 COL1 VARCHAR2(50),
 COL2 VARCHAR2(50),
 ..
 COL5 VARCHAR2(50)

and second for load date as TEXT
(You can use keyword TERMINATED BY ';' for direct delimiter char)

on finish load - EXECUTE spetials PROCEDURE or FUNCTION for distribution
date in work tables

Romanov Alexander
[email protected]
ICQ 6220754
 
 
 
 
 

Hosted by www.Geocities.ws

1