1 Reply Latest reply: May 13, 2013 7:56 AM by François Degrelle RSS

    PLS-00222: no function with name 'P_COPY' exists in this scope

    510316
      Hi,

      When I call this procedure this way it works but halts toad processing and generates a correct package error to toad window:


      FP_INVOICE.P_COPY(p_code,c_val,'MHASAN', SYSDATE,SYSDATE, SYSDATE,'Banner','I');
      DBMS_OUTPUT.PUT_LINE ('Result of cloning invoice =' || p_code || ' ' || cloneresult);

      When I try to assign result to a variable it generates the message in the subject line of this post.

      cloneresult := FP_INVOICE.P_COPY(p_code,c_val,'MHASAN', SYSDATE,SYSDATE, SYSDATE,'Banner','I');
      DBMS_OUTPUT.PUT_LINE ('Result of cloning invoice =' || p_code || ' ' || cloneresult);

      Now I know the procedure does not have an out parameter but calling it without assigning it to a variable does generate an error to toad window. Any solution to this? Do I just have to trap the error?

      Thanks,

      Full Procedure Code:

      /**
      * This procedure copies all the fields for the header, items and accounting records of an invoice into
      * another invoice with the passed in new code and transaction date.
      * @param p_code_from The invoice that is going to be copied. VARCHAR2(8)
      * @param p_code_to_inout The invoice document number for the new invoice. If null or NEXT, the document number
      * will be generated.VARCHAR2(8)
      * @param p_user_id_to The userid of the user invoking this copy function. VARCHAR2(30)
      * @param p_trans_date_to The transaction date for the new invoice. DATE
      * @param p_pmt_due_date_to The payment due date for the new invoice. DATE
      * @param p_data_origin The source of the data. VARCHAR2(30)
      * @param p_invoice_prefix_type_to The prefix character for the document code. VARCHAR2(1)
      */
      PROCEDURE p_copy(
      p_code_from fabinvh.fabinvh_code%TYPE,
      p_code_to_inout IN OUT fabinvh.fabinvh_code%TYPE,
      p_user_id_to fabinvh.fabinvh_user_id%TYPE DEFAULT gb_common.f_sct_user,
      p_trans_date_to DATE DEFAULT SYSDATE,
      p_invoice_date_to DATE DEFAULT SYSDATE,
      p_pmt_due_date_to DATE DEFAULT SYSDATE,
      p_data_origin_to fabinvh.fabinvh_data_origin%TYPE DEFAULT NULL,
      p_invoice_prefix_type_to VARCHAR2 DEFAULT 'I');