Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Problem with dbms_xmldom.isNull() in oracle 9i

Problem with dbms_xmldom.isNull() in oracle 9i

From: <ravi_b_m_at_yahoo.com>
Date: 7 Sep 2005 14:19:44 -0700
Message-ID: <1126127984.446082.25800@g43g2000cwa.googlegroups.com>


Hi All,

        I am using dbms_xmldom.isNull() to check if a dbms_domnodelist is null or not. When the list returned is null, the dbms_xmldom.isNull() is throwing an exception " ORA-01405:fetched column value is NULL".

        I thought that the dbms_xmldom.isNull() will check for the null condition. Am I doing something wrong or is there any other way to check if a given dbms_domnodelist is null.

Thank you all in advance,
Ravi

Following is my code

CREATE OR REPLACE PROCEDURE proc1 (inputXML IN OUT CLOB)IS

--xml doc

    doc_xml XMLTYPE;

--debug purposes

    err_num NUMBER;
    err_msg VARCHAR2(100);
BEGIN
    doc_xml := XMLTYPE(inputXML);
    doc_dom := dbms_xmldom.NEWDOMDOCUMENT(doc_xml);

    node_list :=
dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(doc_dom),'/parent/child');

    dbms_output.PUT('Checking for node ....');     IF NOT dbms_xmldom.ISNULL(node_list) THEN --THIS LINE IS THROWING EXCEPTION
        dbms_output.PUT_LINE(' .... exists');     ELSE
        dbms_output.PUT_LINE(' .... not exists');     END IF;     dbms_xmldom.freeDocument(doc_dom);
EXCEPTION
   WHEN OTHERS THEN

      dbms_xmldom.freeDocument(doc_dom);
      err_num := SQLCODE;
      err_msg := SUBSTR(SQLERRM, 1, 100);
      dbms_output.PUT_LINE(err_msg);

END proc1;
/ Received on Wed Sep 07 2005 - 16:19:44 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US