Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

bcp queryout blob data from oracle Expand / Collapse
Author
Message
Posted Friday, December 28, 2012 3:09 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, January 4, 2013 12:43 PM
Points: 2, Visits: 30
hi @all,

i've got a problem and feel a little out of ideas:
i'va a website where i upload attachments via html input tag (wihout any conversion) into an uploadfile-object on apache myfaces. Using .getBytes i get an java bytearray which will get sent into an oracle 11g database in an BLOB column. Works perfectly fine if it stays like this.

now i got an sql server 2008 database where i'd like to query the data including my blob-column:

bcp "select blob_column from <linked-server>.table where id = 487294" queryout "c:\share\File.pdf" -T -n

works perfectly fine for PDF files. but when i do the same with XLS or XLSX files, it creates the files properly, but when i try to open it, it fails with type problems....

i realized when i compared the files, that in the BCP file there is an 4-byte prefix at the beginning of the file. the rest seams the same. interesting to see, that even in the PDF file, there are 4 heading prefix-bytes. the pdf editor doesnt care...
anyhow.

i also tried to create a format file and used it instead of the -n option. the file looked likes this:
10.0
1
1 SQLBINARY 0 0 "" 2 FileData ""


Didnt work either...

The oracle db runs on an AIX machine.

any ideas would be highly appreciated!!
Post #1400847
Posted Wednesday, January 2, 2013 8:51 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, January 4, 2013 12:43 PM
Points: 2, Visits: 30
nobody able to help? any other ideas, how to solve it?

thanks a lot...
Post #1401879
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse