----------------------------------------
Syntax:
----------------------------------------
CREATE [OR REPLACE] PROCEDURE [PROCEDURE_NAME](ARGUMENTS {IN / OUT / INOUT} DATA-TYPE)
IS/AS
CURSOR DECLARATION;
VARIABLE DECLARATION;
BEGIN
SQL & PL/SQL STATEMENTS;
EXCEPTION
ERROR HANDLING;
END;
/
-----------------------------------------
EXAMPLE:
-----------------------------------------
CREATE OR REPLACE PROCEDURE EMPPROC
IS CURSOR EMPO IS SELECT * FROM EMP;
BEGIN
FOR REC IN EMPO
LOOP
DBMS_OUTPUT.PUT_LINE(REC.EMPNO,REC.NAME,REC.SALARY);
END LOOP;
END;
/
Syntax:
----------------------------------------
CREATE [OR REPLACE] PROCEDURE [PROCEDURE_NAME](ARGUMENTS {IN / OUT / INOUT} DATA-TYPE)
IS/AS
CURSOR DECLARATION;
VARIABLE DECLARATION;
BEGIN
SQL & PL/SQL STATEMENTS;
EXCEPTION
ERROR HANDLING;
END;
/
-----------------------------------------
EXAMPLE:
-----------------------------------------
CREATE OR REPLACE PROCEDURE EMPPROC
IS CURSOR EMPO IS SELECT * FROM EMP;
BEGIN
FOR REC IN EMPO
LOOP
DBMS_OUTPUT.PUT_LINE(REC.EMPNO,REC.NAME,REC.SALARY);
END LOOP;
END;
/
No comments:
Post a Comment