Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning binary data in FOR XML EXPLICIT query

Status
Not open for further replies.

Craftor

Programmer
Joined
Feb 1, 2001
Messages
420
Location
NZ
Hi all

I am trying to return a column that contains IMAGE data in a FOR XML EXPLICIT query - something along the lines of
SELECT 1 AS Tag, NULL AS Parent,
0 AS [data!1!retval!element],
NULL AS [document!2!docid!element],
NULL AS [document!2!docdata!element]
UNION ALL
SELECT 2 AS Tag, 1 AS Parent,
NULL,
DOCID,
DOC_DATA -- binary field
FOR XML EXPLICIT

I get an error saying:

FOR XML EXPLICIT and RAW modes currently do not support addressing binary data as URLs in column 'doclist!2!filedata!element'. Remove the column, or use the BINARY BASE64 mode, or create the URL directly using the 'dbobject/TABLE[@PK1="V1"]/@COLUMN' syntax.

What does the 'dbobject/TABLE[@PK1="V1"]/@COLUMN' actually mean? I'm trying to get a document stored in the DB out so that the user can click on a hyperlink to download it.

Can anyone help with this, please?

Thanks as always

Craftor

8-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top