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!

joins using record type object,coudnt able to join the two tables in pl/sql block

User_35O2QSep 18 2022

i used record type to join the two tables abut couldnt able to join and it is showing me error
declare
type my_rec is record(e_first_name varchar2(30),d_department_id number,d_department_name varchar2(30),
e_employee_id number,e_department_id number);
v_data my_rec;
begin
select e.first_name,d.department_name into v_data from employees e, departments d
where e.department_id=d.department_id and e.employee_id=110;
dbms_output.put_line(v_data.e_first_name);
end;
/
select e.first_name,d.department_name into v_data from employees e, departments d
*
ERROR at line 6:
ORA-06550: line 6, column 52:
PL/SQL: ORA-00913: too many values
ORA-06550: line 6, column 1:
PL/SQL: SQL Statement ignored
kindly sort me out the error which i commited in this block.

Comments
Post Details
Added on Sep 18 2022
2 comments
509 views