Plsql-Examples-doc.pdf - PL\/SQL Examples 1*DISPLAYING THE FIRST FIFTY EVEN NUMBERS BY USING PL\/SQL BLOCK declare i number Begin for i in 1.50 loop if

Plsql-Examples-doc.pdf - PL/SQL Examples 1*DISPLAYING THE...

This preview shows page 1 - 5 out of 47 pages.

PL/SQL Examples 1)/*DISPLAYING THE FIRST FIFTY EVEN NUMBERS BY USING PL/SQL BLOCK*/ declare i number; Begin for i in 1..50 loop if mod(i,2)=0 then dbms_output.put_line('THE EVEN NUMBERS ARE'||i); end if; end loop; end; 2)/*DISPLAYING THE FIRST FIFTY ODD NUMBERS BY USING PL/SQL BLOCK*/ declare i number; begin for i in 1..50 loop if mod(i,2)<>0 then dbms_output.put_line('THE ODD NUMBERS ARE'||i); end if; end loop; 3)/*SCOPE AND VISIBILITY OF VARIABLES IN A PL/SQL PROGRAMME*/ declare one number:=10; two number:=20; three number:=30; begin declare four number:=40; five number:=50; begin dbms_output.put_line('THE LOCAL NUMBERS ARE'||' '||four||' '||five); end; dbms_output.put_line('THE PRIVATE NUMBERS ARE' ||one||' '||two||' '||three); end; end;
Image of page 1
6)/*PRINTING THE VALUE OF THE SALARY OF THE EMPLOYEE NUMBER 7369 BY USING THE BIND VARIABLE*/SQL> variable salary numberbeginselect sal into :salary from emp_dup where empno=7369;
Image of page 2
Image of page 3
Image of page 4
Image of page 5

You've reached the end of your free preview.

Want to read all 47 pages?

  • Spring '18
  • Salary, Complex number, Cursor

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture