PLSQL错误PLS-00302
我创建了以下过程,但它给出了 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果
SEA_USER
架构不存在或者您无权访问它,当您尝试创建列出的过程时,您将收到ORA-01031:权限不足
错误。如果程序主体有效,我看不出它无法编译的原因。鉴于此,如果您在尝试调用存储过程时收到
ORA-06550
错误,那么我能想到的只有两种可能性:您正在从以下位置调用该过程 :
SEA_USER
以外的架构没有合适的
授予的权限允许它
调用另一个用户的过程。
该过程尚未创建于
SEA_USER
架构。您能否向我们提供一个示例,说明您如何调用存储过程并确认您正在使用的用户?
If the
SEA_USER
schema did not exist or you did not have access to it you would receive anORA-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:you are invoking the procedure from
a schema other than
SEA_USER
whichdoes not have the appropriate
permissions granted to allow it to
invoke another user's procedure.
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?