SQL> --write a procedure to print the summation of two numbers passed as parameters SQL> ed Wrote file afiedt.buf 1 create or replace procedure proc_sum(p1 number,p2 number) 2 is 3 begin 4 dbms_output.put_line(p1+p2); 5 exception 6 when others then 7 dbms_output.put_line('error'); 8* end; SQL> / Procedure created. SQL> --run the procedure SQL> --(in sql*plus) SQL> execute proc_sum(34,67) 101 PL/SQL procedure successfully completed. SQL> --call the procedure from another pl/sql block SQL> begin 2 proc_sum(34,67); 3 end; 4 / 101 PL/SQL procedure successfully completed. SQL> ed Wrote file afiedt.buf 1 declare 2 a number := 5; 3 b number := 7; 4 begin 5 proc_sum(a,b); 6* end; SQL> / 12 PL/SQL procedure successfully completed. SQL> ed Wrote file afiedt.buf 1 declare 2 a number := 5; 3 b number := 7; 4 begin 5 b:=proc_sum(a,b); 6* end; SQL> / b:=proc_sum(a,b); * ERROR at line 5: ORA-06550: line 5, column 6: PLS-00222: no function with name 'PROC_SUM' exists in this scope ORA-06550: line 5, column 3: PL/SQL: Statement ignored SQL> ed Wrote file afiedt.buf 1 declare 2 a number := 5; 3 b number := 7; 4 begin 5 dbms_output.put_line( proc_sum(a,b) ); 6* end; SQL> / dbms_output.put_line( proc_sum(a,b) ); * ERROR at line 5: ORA-06550: line 5, column 25: PLS-00222: no function with name 'PROC_SUM' exists in this scope ORA-06550: line 5, column 3: PL/SQL: Statement ignored SQL> --wrıte a procedure that accepts two values as ınput parameters SQL> --and prınt the hıgher of the two valşues on screen SQL> ed Wrote file afiedt.buf 1 create or replace procedure proc_higher(p1 number,p2 number) 2 is 3 v_max number; 4 begin 5 if p1 / Warning: Procedure created with compilation errors. SQL> sho err Errors for PROCEDURE PROC_HIGHER: LINE/COL ERROR -------- ----------------------------------------------------------------- 9/5 PLS-00103: Encountered the symbol "END" when expecting one of the following: . ( * @ % & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset The symbol ";" was substituted for "END" to continue. SQL> ed Wrote file afiedt.buf 1 create or replace procedure proc_higher(p1 number,p2 number) 2 is 3 v_max number; 4 begin 5 if p1 / Procedure created. SQL> begin 2 proc_higher(2,78); 3 end; 4 / 78 PL/SQL procedure successfully completed. SQL> ed Wrote file afiedt.buf 1 begin 2 proc_higher(&anumber,&anotherone); 3* end; SQL> / Enter value for anumber: 12 Enter value for anotherone: 89 old 2: proc_higher(&anumber,&anotherone); new 2: proc_higher(12,89); 89 PL/SQL procedure successfully completed. SQL> / Enter value for anumber: 1 Enter value for anotherone: 1 old 2: proc_higher(&anumber,&anotherone); new 2: proc_higher(1,1); 1 PL/SQL procedure successfully completed. SQL> ed Wrote file afiedt.buf 1 begin 2 proc_higher(&78,&12); 3* end; SQL> / Enter value for 78: 45 Enter value for 12: 96 old 2: proc_higher(&78,&12); new 2: proc_higher(45,96); 96 PL/SQL procedure successfully completed. SQL> spool off