Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Oracle 12c: while creating package getting "PLS-00488: 'EMP_TEST.DEPTNO' must be a type"

Ahmed HaroonMar 5 2018 — edited Mar 7 2018

hi all,

please have a look where i am making mistake creating this package spec:

Table structure:

SQL> desc emp_test

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

EMPNO                                              NUMBER(4)

ENAME                                              VARCHAR2(10)

JOB                                                VARCHAR2(9)

MGR                                                NUMBER(4)

HIREDATE                                           DATE

SAL                                                NUMBER(7,2)

COMM                                               NUMBER(7,2)

DEPTNO                                             NUMBER(2)

DML_TIME                                           VARCHAR2(20)

create or replace package pkg_dml as

  global_charvar_01 varchar2(100);

  global_charvar_02 varchar2(100);

  global_numvar_01 number(20);

  global_numvar_02 number(20);

  global_datevar_01 date;

  global_datevar_02 date;

  --

  function dml_emp_table (dml_id     in varchar2,

                          p_empno    in emp_test.empno%type,

                          p_ename    in emp_test.ename%type default null,

                          p_job      in emp_test.job%type default null,

                          p_mgr      in emp_test.mgr%type default null,

                          p_hiredate in emp_test.hiredate%type default null,

                          p_sal      in emp_test.sal%type default null,

                          p_comm     in emp_test.comm%type default null,

                          p_deptno   in emp_test.deptno default null,

                          p_dml_time in emp_test.dml_time%type default null)

  return varchar2;

end;

/

SQL> /

Warning: Package created with compilation errors.

SQL> show errors

Errors for PACKAGE PKG_DML:

LINE/COL ERROR

-------- -----------------------------------------------------------------

9/3      PL/SQL: Declaration ignored

17/41    PLS-00488: 'EMP_TEST.DEPTNO' must be a type

regards

EDIT: my bad... i overlooked it to add  %type after deptno, now i have made correction as:  p_deptno   in emp_test.deptno%type default null  and compiled successfully

This post has been answered by Billy Verreynne on Mar 6 2018
Jump to Answer

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 4 2018
Added on Mar 5 2018
10 comments
704 views