SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


bcp queryout blob data from oracle


bcp queryout blob data from oracle

Author
Message
munzo
munzo
Valued Member
Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)

Group: General Forum Members
Points: 58 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!! :-)
munzo
munzo
Valued Member
Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)

Group: General Forum Members
Points: 58 Visits: 30
nobody able to help? any other ideas, how to solve it?

thanks a lot...
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search