Loading XML Type into ProC Variable [message #234975] |
Thu, 03 May 2007 10:38 |
lewp
Messages: 2 Registered: May 2007
|
Junior Member |
|
|
Using Oracle 1021, Solaris. I am writing a very simple "select into" query in which I take an XMLTYPE field (which I know will be short, by the way) and load it into a VARCHAR ProC variable.
Not surprisingly, if I try to load the XMLTYPE field directly, I get a type error.
But, now the trouble. Methods that convert the Xml type to a string/varchar, and that work just fine in sqlplus, won't get through the ProC compiler.
For example, If I try substr(XmlFieldName, 1, 1000) I get the message:
PLS-S-00306, wrong number or types of arguments in call to 'SUBSTR'
(I get this even though the exact same call works fine in SQLPlus (outside of the EXEC SQL wrapper of the ProC call))
(I have also tried dbms_lob.substr, to no avail)
I have also tried the XMLSerialize function, as in:
select xmlserialize(content XmlFieldName) and the ProC compiler complains:
PCC-S-02201, Encountered the symbol "XmlFieldName" when expecting one of the following: ,()*+... etc.
So my question is, how do I get the XMLType into a VarChar variable in ProC? Thanks.
|
|
|
|
|
|