0
votes

I have created below procedure but its giving PLS-00302 error. Thanks in Advance :)

ORA-06550: line 11, column 12: PLS-00302: component 'GET_LATEST_LSR_TRANSACTION' must be declared ORA-06550: line 11, column 3: PL/SQL: Statement ignored

CREATE OR REPLACE procedure SEA_USER.Get_Latest_LSR_Transaction (tn IN VARCHAR2, pon OUT VARCHAR2, duedate OUT TIMESTAMP)
IS
    trans_oid NUMBER(10) := 0;
    foc_trans_oid NUMBER(10) := 0;

BEGIN
    SELECT TRANS_OID INTO trans_oid FROM SEA_LSR_TN WHERE tn BETWEEN STARTTN AND ENDTN;

    SELECT MAX(T.OID) INTO foc_trans_oid FROM SEA_LSR_TRANS T, SEA_LSR_TXEVENT_HISTORY H WHERE T.OID IN (trans_oid) AND T.OID = H.TRANS_PARENT_OID AND H.EVENT_CODE IN ('focaccept', 'suppaccept') AND T.REQTYP = 'CB';

    IF foc_trans_oid != 0 
    THEN
        SELECT PON, DUEDATE INTO pon, duedate FROM SEA_LSR_TRANS WHERE OID = foc_trans_oid;
    ELSE
        SELECT PON, DUEDATE INTO pon, duedate FROM SEA_LSR_TRANS WHERE OID = trans_oid;
    END IF;
END;
/
1
Is this a compile error when you create it or an error when you RUN it? If the latter, how do you run it when you get that error? - Tony Andrews
This error comes when I run the procedure. I using Toad tool to create and run the procedure. running it by using "execute procedure" option. - praveen

1 Answers

0
votes

If the SEA_USER schema did not exist or you did not have access to it you would receive an ORA-01031: insufficient privileges error when you try to create the procedure you have listed. Provided the body of the procedure is valid I can see no reason why it would not compile.

Given this, if you are receiving an ORA-06550 error when you try to invoke the stored procedure, then there are only two possibilities that I can think of:

  1. you are invoking the procedure from a schema other than SEA_USER which does not have the appropriate permissions granted to allow it to invoke another user's procedure.

  2. the procedure has not been created in the SEA_USER schema.

Can you provide us with an example of how you are invoking the stored procedure and also confirm the user which you are using?