This content has been marked as final. Show 5 replies
According to what I've read, this is the correct syntaxYes, it's the correct syntax.
yet when the pl/sql is compiled, it throws the following error:So, what's really causing the error? Just running this simple SQL query or compiling some PL/SQL using this query?
ORA-00932: inconsistent datatypes: expected - got CHAR
If you actually use a SELECT INTO, what's the datatype of the target variable?
Give a reproducible test case.
i'm not sure what you mean by a test case. The statement fails in SQL Developer and when being compiled in pl/sql. The pl/sql statement is selecting into an XMLTYPE. When the XMLCDATA function is removed from the statement, the procedure compiles without error. Same for SQL Developer. If I remove the XMLCDATA function, the statement executes.
We are running 10gI overlooked that piece of information.
Always give your complete version when posting, ie the four digits from :
XMLCDATA is available starting with release 10.2.
SELECT * FROM v$version;
XMLCData generates a CDATA section by evaluating value_expr. The value_expr must resolve to a string. The value returned by the function takes the following form:
If the resulting value is not a valid XML CDATA section, then the function returns an error.The following conditions apply to XMLCData:
The value_expr cannot contain the substring ]]>.
If value_expr evaluates to null, then the function returns null.
Thanks for the info. Unfortunately we're running 10.1, so I suppose we'll have to write a function as a workaround.