简体   繁体   English

PLS-00201:必须声明标识符'GETALLNAMES'

[英]PLS-00201: identifier 'GETALLNAMES' must be declared

I am working on store procedure.I write a procedure in oracle 11g and calling the procedure in my java application.Here is my procedure 我正在处理存储过程。我在oracle 11g中编写了一个过程并在我的java应用程序中调用该过程。这是我的程序

create or replace procedure getAllNames
is
CustomerName varchar2(30);
BEGIN
select name INTO CustomerName from customer;
DBMS_OUTPUT.PUT_LINE(CustomerName);
END;
/

When i call the procedure in java it is giving me the error 当我在java中调用该过程时,它给了我错误

PLS-00201: identifier 'GETALLNAMES' must be declared

Tell me what is the mistake i am doing here. 告诉我我在这里做的错误是什么。 I'll be thankful.... :) 我会感恩的.... :)

Edit: You can call the procedure by one of 2 ways in java or any other external application. 编辑:您可以通过Java或任何其他外部应用程序中的两种方法之一调用该过程。

  1. Connecting to same schema where procedure resides. 连接到过程所在的相同模式。

  2. Or give execute permission on the proc to the schema/user you are logged in in java 或者将proc的执行权限授予您在java中登录的架构/用户

Previous Answer: 上一个答案:

It is a good practice using scheme name before procedure name and call it in same manner. 在程序名称之前使用方案名称是一个很好的做法,并以相同的方式调用它。

create or replace procedure GETALLNAMES
as
CustomerName varchar2(30);
BEGIN
select name INTO CustomerName from customer;
DBMS_OUTPUT.PUT_LINE(CustomerName);
END;
/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM