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!

Nested record in pl/sql

950046Jun 4 2013 — edited Jun 5 2013
I have wanted to use nested records in the below mentioned way

Declare
Type emp_type is record(
ename emp.ename%type,
eno emp.eno%type
);
type emp_whole_type is record (
emp_detail emp_type,
dob date
);
emp_type_1 emp_whole_type;
begin
select ename,eno,dob into emp_type_1 FROM EMP; /* Assume only one row is in emp table*/
end;

What i wanted is to restrict the into clause length because in my original example i have to incorporate lot of columns which leads to lot of errors every time if i change something which means i don't want to use like "emp_type_1.emp_detail.ename, emp_type_1.emp_detail.eno,emp_type_1.dbo".

I have even tried with below syntax. It didn't work out i know it's not object.

SELECT EMP_DETAIL(ENAME,ENO),DOB INTO EMP_TYPE_1 FROM EMP

Is it possible to minimize the into clause. Appreciate your suggestions.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 3 2013
Added on Jun 4 2013
4 comments
234 views