compositeAss - t1 tab1 r1 rec i number:=1 maxi number:=3...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 1 declare type rec is record(empname varchar2(20),salary number) type tab1 is table of rec index by binary_integer t1 tab1 r1 rec i number:=1 maxi number begin for r1 in (select ename,sal from emp) loop t1(i).empname:=r1.ename t1(i).salary:=r1.sal i:=i+1 end loop maxi:=i-1 for i in 1..maxi loop dbms_output.put_line('Ename :' || t1(i).empname || ' Salary: ' ||t1(i).salary ) end loop end 2 declare type rec is record(eno number,ename varchar2(20)) type tab1 is table of rec index by binary_integer t1 tab1 r1 rec i number:=1 maxi number begin for r1 in (select empno,ename from emp) loop t1(i).eno:=r1.empno t1(i).ename:=r1.ename i:=i+1 end loop maxi:=i-1 for i in 1..maxi loop dbms_output.put_line('Eno :' || t1(i).eno || ' Ename: ' ||t1(i).ename ) end loop end 3 declare type rec is record(stno number,stmark number) type tab1 is table of rec index by binary_integer
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t1 tab1 r1 rec i number:=1 maxi number:=3 begin Sheet1 Page 2 for i in 1. .maxi loop t1(i).stno:=101+ i t1(i).stmark:=80 + i end loop for i in 1. .maxi loop dbms_output.put_line('StudentNo :' || t1(i).stno || ' Mark: ' ||t1(i).stmark ) end loop end 4 create type student_rec as object( stno number, stname varchar(20), stadd varchar(20) ) declare type tab1 is table of student_rec index by binary_integer t1 tab1 r1 student_rec i number:=1 maxi number:=3 begin for i in 1. .maxi loop r1.stno:=101+ i r1.stname:='Nik' || to_char(i) r1.stadd:='Hinjawadi' || to_char(i) t1(i):=r1 end loop for i in 1. .maxi loop dbms_output.put_line('StudentNo :' || t1(i).stno || ' StName: ' ||t1(i).stname || ' StAddress: ' ||t1(i).stadd ) end loop end Sheet1 Page 3 Sheet1 Page 4...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern