sql Loader and the first field terminator [message #69327] |
Mon, 10 December 2001 17:54 |
Jim Willis
Messages: 11 Registered: October 2001
|
Junior Member |
|
|
I have a file:
|1234|oupju|
there's really only 2 fields but good ol extractor from SAP puts in the "|" in the first column - so here's my question, how can I use the field terminated by '|' and bypass the first column because sql loader will treat that as null
here's my table
table A
( col1
col2
)
I hope this makes sense because I've looked at the online docs for sql loader and other than using "position", which I don't want to do and of course (sed to edit out the first occurance of | ) from the file, I'm hoping for a simpler solution. I've only described 2 of over 100 columns of a file - so you can see why I prefer not to use "position"
Thanks Jim
----------------------------------------------------------------------
|
|
|
Re: sql Loader and the first field terminator [message #69330 is a reply to message #69327] |
Tue, 11 December 2001 03:58 |
Suresh Vemulapalli
Messages: 624 Registered: August 2000
|
Senior Member |
|
|
I think simple solution for this problem is cheating sqlloader. Add one extra column to your existing table, let's say dummy.
alter table tableA add dummy varchar2(1);
write control file like below
LOAD DATA
INFILE 'SAP.txt'
APPEND
INTO TABLE tableA
fields terminated by '|'
(dummy ,
col1 ,
col2 )
That's it.. As you know, we can always drop column (dummy) from table once load is done.
How about this solution?.
----------------------------------------------------------------------
|
|
|