Skip to Main Content
  • Questions
  • PLS-00103: Encountered the symbol "RECORD" when expecting one of the following: array varray table object fixed varying opaque sparse

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, sai niranjan.

Asked: March 13, 2024 - 8:47 am UTC

Last updated: March 14, 2024 - 2:41 pm UTC

Version: 19C

Viewed 1000+ times

You Asked

Here i am creating record type with reocrds emp and dept with following syntax

CREATE TYPE emp_dept_data IS RECORD
(empno number(4),
ENAME             VARCHAR2(10),
JOB               VARCHAR2(9),
HIREDATE          DATE,
SAL               NUMBER(7,2),
DNAME           VARCHAR2(14)
);


I am getting error as PLS-00103: Encountered the symbol "RECORD" when expecting one of the following: array varray table object fixed varying opaque sparse

Please tell me how to fix it i am using oracle 19C version

Record type is used in pipelined function

and Chris said...

Either you need to create a SQL type or a PL/SQL record:

SQL Type

create type emp_dept_data is object (
  empno           number(4),
  ename           varchar2(10),
  job             varchar2(9),
  hiredate        date,
  sal             number(7,2),
  dname           varchar2(14)
);
/


PL/SQL record

declare 
  type emp_dept_data is record ( 
    empno           number(4),
    ename           varchar2(10),
    job             varchar2(9),
    hiredate        date,
    sal             number(7,2),
    dname           varchar2(14)
  );
begin
  null;
end;
/