Link to home
Start Free TrialLog in
Avatar of IzabellaK
IzabellaK

asked on

sql loader : record delimiter

Is it possible to change the predefined (newline) record (row) delimiter for sqlldr ?

(Records in my *.txt file are delimited by '[]'.)
Avatar of bkowalski
bkowalski

Yes, use the "terminated by" clause, for example:

load data
truncate
into table <tablename>
fields terminated by '[]'
Avatar of IzabellaK

ASKER

As I mentioned in my question,
I have to delimit not fields but records (a set of fields).
INFILE filename.dat "STR '^'"
The above will change the record delimiter to the carret character "^". You can specify any string there - it can be a whole string, not only character.
You can also specify it in hexadecimal format to avoid character set problems:
INFILE filename.dat "STR x'1234'"
The default record delimiter is '\n'.

Hope that helps!
It's a good solution for constant file name;
but how should I specify it in case of :

sqlldr data=... ?
It's a good solution for constant file name;
but how should I specify it in case of :

sqlldr data=... ?
ASKER CERTIFIED SOLUTION
Avatar of pennnn
pennnn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you.