Home » RDBMS Server » Server Utilities » How to specify row terminater in SQLLDR command
How to specify row terminater in SQLLDR command [message #71246] Mon, 30 September 2002 21:26 Go to next message
Ashok Mishra
Messages: 4
Registered: September 2002
Junior Member
Hi,
We are using the slldr to load the data from text file. This text file is generated using the SQL-Server's BCP utility. While genarting the text file we specify -rn for BCP to give the n as row terminater. Same way we want to pass it to the SQLLDR also. Any input is greatly appreciated. Since having n SQLLDR is counting field data (if a filed has n) as a seperate record.

Thanks,
Ashok
Re: How to specify row terminater in SQLLDR command [message #71248 is a reply to message #71246] Tue, 01 October 2002 04:01 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
just create a csv( comma seperated values) file.
with sql*loader control file you can say as
terminated by ',' 

[Updated on: Thu, 16 March 2006 16:40]

Report message to a moderator

Re: How to specify row terminater in SQLLDR command [message #71258 is a reply to message #71246] Wed, 02 October 2002 20:45 Go to previous messageGo to next message
Ashok Mishra
Messages: 4
Registered: September 2002
Junior Member
Dear mahesh,
Thanks for your prompt response. Actually I am already having the csv but my problem is that few of our records are having the linefeed in the data since linefeed is the default row terminator for the sqlldr hence it breaks one re4cord into two. One solution is to put INFILE "file.dat" "str '&#124rn'" and while generating the file.dat use the same row terminator as "&#124rn" but my problem is that we don't want to put INFILE params in ctl files rather we are using sqlldr and passing the file.dat as data=file.dat command line parameter and putting the "str '&#124rn' gives error saying that multiple valuse not allowed in option data. Since we construct the name of data file dynamically at run time and execute the sqlldr command from an automated script so we want the solution to avoid the hardcoding of INFILE param in ctl files (large number of ctl files to edit is huge task).

Regards,
Ashok
Re: How to specify row terminater in SQLLDR command [message #71280 is a reply to message #71246] Tue, 08 October 2002 22:06 Go to previous message
Ashok Mishra
Messages: 4
Registered: September 2002
Junior Member
Greetings!!!!

Its so simple I didn't imagine..on DOS BCP is puting rn in the text file so if you just put
INFILE "" "str '&#124rn'"

in to CTL file and pass sqlldr data="infile" ......
then it will be like

INFILE 'infile' "str '&#124rn'"

and use -r"&#124n" in your BCP you are all set..

This experiment solved my problem
Previous Topic: truncation of preceeding zeros while loading from csv into oracle table in varchar2 kind of field
Next Topic: Re: Help me!!!
Goto Forum:
  


Current Time: Mon Apr 29 01:58:48 CDT 2024