Databases
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives FAQs Databases

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old June 25th, 2008, 10:31 AM
Bumsys
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
using bcp.exe

I have database: au12
in this database I have table: au_log
and in the table field: logfile type image
I want to load file c:\temp\test.rar with bcp.exe
username: sa
Can anyone write me how it to do?

Reply With Quote
  #2  
Old June 25th, 2008, 12:10 PM
SybaseNeal
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
using bcp.exe

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 au12au_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).

NTE: 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 au12au_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 au12au_log

Reply With Quote
Reply

Viewing: Web Development Archives FAQs Databases > using bcp.exe


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway