Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Sybase > Re: using bcp.e...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 2500 of 2544
Post > Topic >>

Re: using bcp.exe

by SybaseNeal <nstack21@[EMAIL PROTECTED] > Jun 25, 2008 at 09:16 AM

Hello,

With image or text data that contains embedded control characters such
as \t or \n you must be careful.

1) Either bcp out in the native format (-n):
   bcp.exe au12..au_log out c:\temp\test.rar -Usa -P -n -T 123456789
(123456789 is the maximum size of the text/image column in your table
+ a little extra
The default maximum text/image size will be 32768.  Anything larger
will be truncated
unless you use the "-T" parameter).

NOTE: Files copied out in the native format (-n) can only be used on
the platform they were created.
Don't try to take a native bcp file created on Windows and use it on
Solaris.

2) If you want the data in a character format (-c) you can use the
following command but
you must specify row & column terminators that you are sure are not in
your data:
   bcp.exe au12..au_log out c:\temp\test.rar -Usa -P -c -T 123456789 -
t "^%^%" -r "$~$~"

If you do not specify "-t" and "-r" the default row terminator is "\r
\n" (on Windows) and the
default column terminator is \t.  So if your text/image data also has
these characters bcp
will become very confused.

Thanks,
  Neal

p.s. You can type the following command to find the maximum text
length of your column
to help you decide what a good value for "-T" might be:

  select max(datalength(logfile)) from au12..au_log
 




 6 Posts in Topic:
using bcp.exe
Bumsys@[EMAIL PROTECTED]   2008-06-25 07:59:07 
Re: using bcp.exe
SybaseNeal <nstack21@[  2008-06-25 09:16:47 
Re: using bcp.exe
Bumsys@[EMAIL PROTECTED]   2008-06-26 02:53:01 
Re: using bcp.exe
Bumsys@[EMAIL PROTECTED]   2008-06-26 04:31:48 
Re: using bcp.exe
SybaseNeal <nstack21@[  2008-06-26 06:50:45 
Re: using bcp.exe
bret@[EMAIL PROTECTED]   2008-06-26 09:03:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 12:33:46 CDT 2008.