compositeAss

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

Info iconThis 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background 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

Page1 / 4

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

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online