How to specify row terminater in SQLLDR command [message #71246] |
Mon, 30 September 2002 21:26 |
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 #71258 is a reply to message #71246] |
Wed, 02 October 2002 20:45 |
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 '|rn'" and while generating the file.dat use the same row terminator as "|rn" 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 '|rn' 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 |
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 '|rn'"
in to CTL file and pass sqlldr data="infile" ......
then it will be like
INFILE 'infile' "str '|rn'"
and use -r"|n" in your BCP you are all set..
This experiment solved my problem
|
|
|