Syntax of the Create Package
CREATE OR REPLACE PACKAGE [body] packagename IS
END;
Sample:
CREATE OR REPLACE PACKAGE overloaded IS
PROCEDURE insby(namein VARCHAR2);
PROCEDURE insby(numbin PLS_INTEGER);
END overloaded;
/
CREATE OR REPLACE PACKAGE BODY overloaded IS
--==========================================
PROCEDURE local(namein VARCHAR2, nameout OUT VARCHAR2) IS
BEGIN
nameout := TRANSLATE(namein,'AEIOUaeiou','EIOUAeioua');
END local;
--==========================================
PROCEDURE insby (namein VARCHAR2) IS
x PLS_INTEGER;
BEGIN
SELECT MAX(seqno)+1
INTO x
FROM persons;
INSERT INTO persons
(seqno, name)
VALUES
(x, namein);
COMMIT;
END insby;
--==========================================
PROCEDURE insby (numbin PLS_INTEGER) IS
x VARCHAR2(30);
BEGIN
SELECT MAX(name)
INTO x
FROM persons;
local(x, x);
INSERT INTO persons
(seqno, name)
VALUES
(numbin, x);
COMMIT;
END insby;
--==========================================
END overloaded;
/
exec overloaded.insby('Helen Lofstrom');
exec overloaded.insby(4);
Syntax of the Drop Package
DROP PACKAGE [BODY] [schema.]package_name;
Sample:
DROP PACKAGE INV.INV_TRANSFER_ORDER_PVT;
DROP PACKAGE BODY INV.INV_TRANSFER_ORDER_PVT; 本文出自:億恩科技【mszdt.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|