问题
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
回答1:
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;
回答2:
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
回答3:
Try this :
declare c varchar2(100);
begin
hr.getquote('001', c);
end;
/
In pl/sql single quotes must be used for strings.
来源:https://stackoverflow.com/questions/6577490/calling-oracle-pl-sql-pls-00201-identifier-001-must-be-declared