2 Replies Latest reply: Oct 16, 2013 10:51 AM by Olga12 RSS

    PL/SQL in reports

    Olga12

      Hello,

      Please, look at the formula below....is the syntax and placement of EXCEPTION correct?

       

      FUNCTION CF_API_MONO_DESCFormula
         RETURN CHAR
      IS
         lv_test_detail_txt   VARCHAR2 (2000);
      BEGIN
         srw.MESSAGE (2, 'In CF_API_MONO_DESC');
      
      
         BEGIN
            SELECT xco.config_node_desc
              INTO lv_test_detail_txt
              FROM oe_order_headers_all ooh,
                   oe_order_lines_all ool,
                   xops_config_sessions xcs,
                   xops_config_output xco
             WHERE     ooh.header_id = ool.header_id
                   AND ool.config_header_id = xcs.config_hdr_id
                   AND xcs.fci_id = xco.fci_id
                   AND xco.config_node_name = 'API_MONO_SEL'
                   AND ooh.order_number = :p_order_number
                   AND ool.line_number = :p_line_number
                   AND ROWNUM < 2;
         EXCEPTION
            WHEN OTHERS
            THEN
               srw.MESSAGE (2, 'In CF_API_MONO_DESC, Error : ' || SQLERRM); 
         --lv_test_detail_txt := NULL;
         END;
         srw.MESSAGE (2, 'In CF_API_MONO_DESC' || lv_test_detail_txt);
         RETURN (lv_test_detail_txt);
      END;
      

      Thank you very much