Monday, 6 February 2017

PLS-00201 error

You might face "PLS-00201 " error while creating object type .

Unfortunately Oracle is not supporting to have %type in SQL while creating object type.

as we know Object type belongs to SQL so we should not  use %type which is from PLSQL.

Instead of %TYPE ,use SQL data types to resolve this issue.

Eg:

SQL> create or replace type sal_rec is object
  2  (v_SALGRADE emp.sal%type);
  3  /

Warning: Type created with compilation errors

SQL> sho err;
Errors for TYPE SCOTT.SAL_REC:

LINE/COL ERROR
-------- ------------------------------------------------
2/13     PLS-00201: identifier 'EMP.SAL' must be declared
0/0      PL/SQL: Compilation unit analysis terminated


SQL>
SQL> create or replace type sal_rec is object
  2  (v_SALGRADE integer);
  3  /
 
Type created


SQL>

No comments:

Post a Comment