Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flat files processing

Status
Not open for further replies.

drkestrel

MIS
Sep 25, 2000
439
GB
I need to 'import' a flat files into Oracle 8i. The problem is the file is NOT 'delimited'. Instead, the field are of defined sizes.
i.e.
Code:
<-10chars--><--11chars--><-10chars--><--11chars-->
   field 1  field   2     field    1  field   2
Hence, I have rows of two fields, with first field of 10 chars and second field of 11field in chars. With things like BCP, I could specify this to be imported.

However, there appears to be a requirement for Oracle SQLLoader that delimiter be used. Is this really the case? If not, could someone please tell me how I could import files like the above into a table like the below-
Code:
Table1
Field1  Varchar(10)
Field2  Varchar(11)

Or would there be any other Oracle tool to do this? For simpliciy, I would rather not have to write a parser using perl/awk, etc. etc...
 
This is possible, according to the documentation in the Oracle utilities manual - I have the 8.0.6 manual, but presumably this sort of thing isn't likely to change. It gives the following example:

LOAD DATA
INFILE 'ulcase2.dat'
INTO TABLE emp
(empno POSITION(01:04) INTEGER EXTERNAL,
ename POSITION(06:15) CHAR,
job POSITION(17:25) CHAR,
mgr POSITION(27:30) INTEGER EXTERNAL,
sal POSITION(32:39) DECIMAL EXTERNAL,
comm POSITION(41:48) DECIMAL EXTERNAL,
deptno POSITION(50:51) INTEGER EXTERNAL)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top