Hi Team,
I have written the below code to store the data returned from a select into nested table in PLSQL. When I run the code, I am getting the error mentioned below. Any help is really appreciated.
create or replace type tr_empdata is object
(
empid number(10),
ename varchar2(80)
);
create or replace type nt_emp is table of tr_empdata;
declare
l_empdata nt_emp;
begin
Select employee_id , concat(first_name||' ',last_name) ename into l_empdata
from employees;
end;
/
Error:
Error starting at line 8 in command:
declare
l_empdata nt_emp;
begin
Select employee_id , concat(first_name||' ',last_name) ename into l_empdata
from employees;
end;
Error report:
ORA-06550: line 4, column 77:
PL/SQL: ORA-00947: not enough values
ORA-06550: line 4, column 1:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.