CREATE OR REPLACE PROCEDURE scott.sample_proc1
AUTHID DEFINER
AS
BEGIN
INSERT INTO detail_proc_insert
VALUES(1,'hello');
END;
/
|
CREATE PROCEDURE scott.sample_proc1
AUTHID DEFINER
AS
BEGIN
INSERT INTO detail_proc_insert
VALUES(1,'hello');
END scott.sample_proc1;
|
CREATE OR REPLACE PROCEDURE scott.sample_proc2
AUTHID DEFINER
AS
x NUMBER(9,2);
BEGIN
x := 65400;
END;
/
|
CREATE PROCEDURE scott.sample_proc2
AUTHID DEFINER
AS
x NUMBER(9,2);
BEGIN
x := 65400;
END scott.sample_proc2;
|
CREATE OR REPLACE PROCEDURE scott.sample_proc3
IS
detected EXCEPTION;
PRAGMA EXCEPTION_INIT(detected, -60);
BEGIN
null; -- some comment
EXCEPTION
WHEN deadlock_detected THEN
null; -- handling error
END;
/
|
CREATE PROCEDURE scott.sample_proc3
IS
detected EXCEPTION;
PRAGMA EXCEPTION_INIT(detected, -60);
BEGIN
null; -- some comment
EXCEPTION
WHEN deadlock_detected THEN
null; -- handling error
END scott.sample_proc3;
|
CREATE OR REPLACE PROCEDURE scott.sample_proc4
IS
num_tables NUMBER;
BEGIN
SELECT COUNT(*)
INTO num_tables
FROM dual;
IF num_tables < 1000 THEN
raise_application_error(-20101,
'Issuing message');
ELSE
NULL; -- comment
END IF;
END;
/
|
CREATE PROCEDURE scott.sample_proc4
IS
num_tables NUMBER;
BEGIN
SELECT COUNT(*)
INTO num_tables
FROM dual;
IF num_tables < 1000 THEN
raise_application_error(-20101, 'Issuing message');
ELSE
NULL; -- comment
END IF;
END scott.sample_proc4;
|
CREATE PROCEDURE scott.sample_proc5
IS
num_tables NUMBER;
dual_rec dual%ROWTYPE;
my_D emp.ename%TYPE;
BEGIN
SELECT COUNT(*) INTO num_tables
FROM dual;
END;
/
|
CREATE PROCEDURE scott.sample_proc5
IS
num_tables NUMBER;
dual_rec dual%ROWTYPE;
my_D emp.ename%TYPE;
BEGIN
SELECT COUNT(*) INTO num_tables
FROM dual;
END scott.sample_proc5;
|