1 Reply Latest reply: Dec 23, 2013 7:01 AM by Partha Sarathy S RSS

    EXCEPTION PROBLEM!

    a2c8c05c-d6f5-4326-87f1-626c6919d501

      Hello!

       

      Is it possible to make an exception when error is in established line?

       

      For example this is fragment of my code:

       

      l_XMLvalue := l_xmltype.extract('/SHOW_SHIPMENT_005/DATAAREA/SHOW_SHIPMENT/SHIPMENT/SHIPITEM/QUANTITY/VALUE/text()').getStringVal();

      dbms_output.put_line('QUANTITY: '||l_XMLvalue);

      l_XMLdocument_id := l_xmltype.extract('/SHOW_SHIPMENT_005/DATAAREA/SHOW_SHIPMENT/SHIPMENT/SHIPITEM/DOCUMNTREF/DOCUMENTID/text()').getStringVal();

      dbms_output.put_line('DOCUMENT ID:' ||l_XMLdocument_id);

      l_XMLdoc_release := l_xmltype.extract('/SHOW_SHIPMENT_005/DATAAREA/SHOW_SHIPMENT/SHIPMENT/SHIPITEM/DOCUMNTREF/USERAREA/DOCUMENTRELEASE/text()').getStringVal();

      dbms_output.put_line('DOCUMENT RELEASE:' ||l_XMLdoc_release);

      l_XMLlinenum := l_xmltype.extract('/SHOW_SHIPMENT_005/DATAAREA/SHOW_SHIPMENT/SHIPMENT/SHIPITEM/DOCUMNTREF/LINENUM/text()').getStringVal();

      dbms_output.put_line('LINE NUMBER:' ||l_XMLlinenum);

      l_XMLsch_lnum := l_xmltype.extract('/SHOW_SHIPMENT_005/DATAAREA/SHOW_SHIPMENT/SHIPMENT/SHIPITEM/DOCUMNTREF/SCHLINENUM/text()').getStringVal();

      dbms_output.put_line('SCHIPMENT LINE NUMBER:' ||l_XMLsch_lnum);

       

      When function extract is trying to fetch value and there will be NULL the program will stop. It is possible make an exception :

      WHEN SELF_IS_NULL THEN

      dbms_output.put_line('There is a problem with empty values in XML file');

       

      The think which i want to do is check in which line the error is occur to write the exception WHICH EXACTLY VALUE IS WRONG!

       

      Thanks,

      Mariusz