Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Problem with dbms_xmldom.isNull() in oracle 9i
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);
![]() |
![]() |