0% found this document useful (0 votes)
54 views2 pages

Programs of Oracle

The document defines a type table and varray, populates them with sample data, and loops through outputting the values. It also defines a record type and selects sample data into it from a table, outputting the field values.

Uploaded by

scc_12
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views2 pages

Programs of Oracle

The document defines a type table and varray, populates them with sample data, and loops through outputting the values. It also defines a record type and selects sample data into it from a table, outputting the field values.

Uploaded by

scc_12
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Programs Of Oracle declare type vmarktype is Table of integer; total number; Y vmarktype; begin Y:=vmarktype(25,50,4,123,145); total := Y.

count; for i in 1..total loop dbms_output.put_line('Y is : ' || Y(i)); end loop; end;

declare type t_emprec is record ( r_empno emp.empno%type, r_ename emp.ename%type, r_sal emp.sal%type); v_emprec t_emprec; begin select empno,ename,sal into v_emprec from emp where empno=&empno; dbms_output.put_line('empno is :' || v_emprec.r_empno); dbms_output.put_line('ename is :' || v_emprec.r_ename); dbms_output.put_line('salary is :' || v_emprec.r_sal); end; declare type vmarktype is varray(10) of integer; total number; X vmarktype; begin X:=vmarktype(25,50,4,123,145); total := X.count; for i in 1..total

loop dbms_output.put_line('X is : ' || X(i)); end loop; end;

You might also like