2

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
OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
Oh Chin Boon
  • 23,028
  • 51
  • 143
  • 215

3 Answers3

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;
WW.
  • 23,793
  • 13
  • 94
  • 121
1

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

Randy
  • 16,480
  • 1
  • 37
  • 55
0

Try this :

declare c varchar2(100);

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

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

Maxim Shevtsov
  • 212
  • 1
  • 3
  • 10