PLSQL错误PLS-00302

发布于 2024-09-18 12:43:21 字数 969 浏览 3 评论 0原文

我创建了以下过程,但它给出了 PLS-00302 错误。提前致谢 :)

ORA-06550:第 11 行,第 12 列:PLS-00302:组件 “GET_LATEST_LSR_TRANSACTION”必须是 声明 ORA-06550: 第 11 行,第 3 列: PL/SQL:语句被忽略

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;
/

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;
/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

菩提树下叶撕阳。 2024-09-25 12:43:21

如果SEA_USER架构不存在或者您无权访问它,当您尝试创建列出的过程时,您将收到ORA-01031:权限不足错误。如果程序主体有效,我看不出它无法编译的原因。

鉴于此,如果您在尝试调用存储过程时收到 ORA-06550 错误,那么我能想到的只有两种可能性:

  1. 您正在从以下位置调用该过程 :
    SEA_USER 以外的架构
    没有合适的
    授予的权限允许它
    调用另一个用户的过程。

  2. 该过程尚未创建于
    SEA_USER 架构。

您能否向我们提供一个示例,说明您如何调用存储过程并确认您正在使用的用户?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文