Wednesday 27 July 2016

Package Example in Oracle

As salamo alaikum wa rahmatullah
------------------------------------------

-- Package Example
-- Package Specification

Create or Replace Package Pck_Test
as
procedure PrcPck_Test(eno IN Number);
end Pck_Test;

-- Package Body 

Create or Replace Package body Pck_Test
as
Procedure PrcPck_Test(eno IN Number)
as
enm varchar(50);
begin
select ename into enm from emp where empno=eno;
dbms_output.put_line('Employee no ->'||eno|| '  Employee name ->'|| enm);
exception
when others then
dbms_output.put_line('No data found'||enm);
end PrcPck_Test;
end Pck_Test;

-- output

begin
PCK_TEST.PRCPCK_TEST(7788);
end;

--


--
Ma Asalaam
Passion 4 Oracle

No comments:

Post a Comment