[英]Oracle PL/SQL: calling stored procedure with parameters
I have created a stored procedure and compiled it successfully without any errors. 我已经创建了一个存储过程,并成功地对其进行了编译,没有任何错误。 However, when I call it within an annoynmous block, it returns an error message
PLS-00201: identifier 'DUE_FOR_RAISE' must be declared
. 但是,当我在异常块中调用它时,它返回错误消息
PLS-00201: identifier 'DUE_FOR_RAISE' must be declared
。 What seems to be wrong? 怎么了? Is there something wrong with the procedure calling?
过程调用有问题吗? This is what I used to call the procedure:
BEGIN due_for_raise('Austin'); END;
这就是我用来调用该过程的内容:
BEGIN due_for_raise('Austin'); END;
BEGIN due_for_raise('Austin'); END;
It's because you've quoted your procedure name (never do this). 这是因为您已经引用了过程名称(从不引用)。 You need to call it with quotes and exactly the same casing as you used to name the procedure, so:
你需要用引号和完全相同的外壳,你用来命名的程序,所以把它称为:
BEGIN
"due_for_raise"('Austin');
END;
If would be easier to drop your old procedure, and re-create it without a quoted name. 如果这样会更容易删除旧的过程,然后重新创建它,且不带引号。
To quote from the documentation on Database Object Names and Qualifiers : 要引用有关数据库对象名称和限定符的文档:
Oracle does not recommend using quoted identifiers for database object names.
Oracle建议不要为数据库对象名称使用带引号的标识符。 These quoted identifiers are accepted by SQL*Plus, but they may not be valid when using other tools that manage database objects.
这些带引号的标识符已被SQL * Plus接受,但是在使用其他管理数据库对象的工具时,它们可能无效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.