XML Database (MOSC)

MOSC Banner

DBMS_XMLQUERY : Invalid context handle specified

edited Mar 28, 2014 8:57AM in XML Database (MOSC) 4 commentsAnswered

Hello,

Here is the simple code :

set serveroutput on;

declare

str_sql VARCHAR2(200) := ' (select * from dual)  '; 

res_xml                 CLOB;

   v_context   DBMS_XMLQUERY.ctxtype;

begin

   v_context := DBMS_XMLQUERY.newcontext (str_sql);

   res_xml := DBMS_XMLQUERY.getxml (v_context);

   DBMS_OUTPUT.PUT_LINE('res_xml : ' || res_xml);

   DBMS_XMLQUERY.closecontext (v_context);

end;

/

I had recently install a 11.2.0.4 Oracle Database and I got this exception : <ERROR>oracle.xml.sql.OracleXMLSQLException: Descripteur de contexte indiqué non valide.</ERROR>

When I replace the query by this : 'select * from dual' I get the result (OK) :

res_xml : <?xml version = '1.0'?>

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center