Calling Oracle PL/SQL PLS-00201: identifier '0

2019-07-16 07:03发布

I am trying to call a PL/SQL script with the following header:

PL/SQL:

CREATE OR REPLACE PROCEDURE GETQUOTE(i_QUOTEID IN HR.QUOTEID,
                                     o_QUOTE OUT HR.QUOTE)

Execute command:

DECLARE c VARCHAR2(100);

BEGIN

  HR.GETQUOTE("001", c);

END;
/

Error:

declare
c varchar2(100);
begin
HR.GETQUOTE("001", c);
end;

ORA-06550: line 4, column 29:
PLS-00201: identifier '001' must be declared
ORA-06550: line 4, column 1:
PL/SQL: Statement ignored

3条回答
Evening l夕情丶
2楼-- · 2019-07-16 07:13

Try this :

declare c varchar2(100);

begin    
  hr.getquote('001', c);    
end;    
/

In pl/sql single quotes must be used for strings.

查看更多
狗以群分
3楼-- · 2019-07-16 07:21

use the single quotes:

then

check that the first value is a string not a number inside the procedure. you may also try to_number('001') as the argument

查看更多
可以哭但决不认输i
4楼-- · 2019-07-16 07:27

You are using the wrong types of quotes. If you want 001 to be string literal, you need to use single quotes.

Try this:

SELECT '001' FROM dual;

SELECT "001" FROM dual;
查看更多
登录 后发表回答