Sunday, June 21, 2009

procedures in pl/sql in Oracle

1.procedure can use the return statement to return the control back to calling subprogram.
2.function can return a values as well it can be used anywhere in a SQL statement.

create or replace procedure proc_highpayee
as
varEno NUMBER default 0;
begin
select eno into varEno from emp where sal = (select max(sal)from emp) and rownum =1;
return;
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE ('No Data found for SELECT ');
end;

No comments:

Post a Comment