PROCEDURE AUDITMUL IS
BEGIN
PACAA_COUNT := PACAA_COUNT + 1;
INSERT INTO TabAUD VALUES(PACAA_COUNT,
SYSDATE); COMMIT;
END;
END;
Package body created.
Misol. Paket yaratishga yana bir misol.
CREATE PACKAGE pkgSalary As
FUNCTION fSalary(emp_id IN number) RETURN number;
PROCEDURE pSalary(emp_id number, nSalary number);
END pkgSalary;
Paketning asosiy qismini yaratish:
CREATE PACKAGE body pkgSalary AS
FUNCTION fSalary(emp_id IN number) RETURN number
is nSalary number(10,2);
BEGIN
SELECT salary into nSalary from employees where employee_id =
emp_id;
RETURN nSalary;
END;
PROCEDURE pSalary(emp_id number, nSalary number) AS
BEGIN
update hr.employees set salary = nSalary where employee_id =
emp_id;
END;
END pkgSalary;