Monday 30 June 2014



To write a pl/sql program to find sum of two numbers.
Procedure:

Declare

i number(3);
j number(3);
k number(3);

           Begin
                     i:=&i;
                     j:=&j;
                     k:=i+j;

                     Dbms_output.put_line('the sum of '||i||','||j||'is:'||k);
           end;
Execution:
SQL> @e:\sqlpl\add.sql
Enter value for i: 4
old 6: i:=&i;
new 6: i:=4;
Enter value for j: 4
old 7: j:=&j;
new 7: j:=4;
the sum of 4,4 is:8

PL/SQL procedure successfully completed.
Conclusion:

A pl/sql program is successfully executed for finding sum of two numbers.

4 comments:

Copyright © ORACLE-FORU - SQL, PL/SQL and ORACLE D2K(FORMS AND REPORTS) collections | Powered by Blogger
Design by N.Design Studio | Blogger Theme by NewBloggerThemes.com