If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 9.1 - Problem in using XMLAGG

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-05-09, 22:24
db2udbgirl db2udbgirl is offline
Registered User
 
Join Date: Mar 2006
Location: Tuticorin, India
Posts: 100
DB2 9.1 - Problem in using XMLAGG

Env: AIX 5.3 / DB2 9.1

I am trying to use XMLAGG function but for some reason it fails. We just upgraded to DB2 9.1 hence i am not sure whether I need to turn on any other switch to use XMLAGG function. Please advice.

/tmp > db2 describe table tt

Column Type Type
name schema name Length Scale Nulls
------------------------------ --------- ------------------ -------- ----- ------
COL1 SYSIBM VARCHAR 10 0 Yes

1 record(s) selected.

/tmp> db2 "select * from tt"

COL1
----------
welcome
DB2
9.1

3 record(s) selected.

/tmp> db2 -tvf q2.sql
SELECT XMLSERIALIZE( XMLQUERY('/fn:data(COL1)' PASSING XMLDOCUMENT( XMLAGG(XMLELEMENT(NAME "COL1", COL1))) ) AS CLOB(50) EXCLUDING XMLDECLARATION) FROM TT
SQL0104N An unexpected token "PASSING XMLDOCUMENT( XMLAGG(XMLELEMENT(NA" was
found following "ERY('/fn:data(COL1)'". Expected tokens may include:
"<space>". SQLSTATE=42601
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On