XML Query Syntax Problem [message #273214] |
Tue, 09 October 2007 09:47 |
panzertape
Messages: 20 Registered: August 2007
|
Junior Member |
|
|
Hi!
I have a simple XML Query against my DB, but I'm having trouble with the right syntax, because of an ORA-00907 missing right parenthesis error
select XMLElement("OBJECTS",
XMLForest(obj.ID,obj.PID,obj.NAME),
(
select XMLAgg(
XMLElement("GROESSEN",
XMLForest(gro.ID,gro.WERT)
)
)
from GROESSEN gro where gro.id = obj.id
select XMLAgg(
XMLElement("OBJ_NAM",
XMLForest(objnam.ID,objnam.ID_NAME)
)
)
from PADBS_OBJ_NAM objnam where objnam.id = obj.id and objnam.id_name = gro.id_name
)
)
from PADBS_OBJECTS obj where obj.ID = 16116
I want to create an output as follows:
<OBJECTS>
<ID></ID>
<PID></PID>
<NAME></NAME>
<GROESSE>
<ID></ID>
<WERT></WERT>
</GROESSE>
<OBJ_NAM>
<ID></ID>
<ID_NAME></ID_NAME>
</OBJ_NAM>
</OBJECTS>
But I don't see where I am missing a paranthesis
perhaps you can point me into the right direction. Would be great!
thanks in advance
panzertape
|
|
|
|
|
Re: XML Query Syntax Problem [message #273767 is a reply to message #273635] |
Thu, 11 October 2007 10:56 |
panzertape
Messages: 20 Registered: August 2007
|
Junior Member |
|
|
ok, now I solved this problem by using group by at the end...
But now I have another one...
I just want to add <?xml version="1.0" encoding="ISO-8859-1"?> on top of the generated XML-data.
But the XMLRoot()-Function doesn't support the specification of the encode-parameter.
I tried to add
select XMLType ('<?xml version="1.0" encoding="ISO-8859-1"?>' || before the XMLElements-Statements but ending up with
ORA-19011: Character string buffer too small
(adding .getClobVal() at the end throws the same error)
Does someone know how I can mange this?
|
|
|