PL-SQL Procedure


Prev Tutorial Next Tutorial

PL-SQL Procedure

A pl-sql Procedure does not return any value. Procedure in pl-sql have two sections;

  • Declaration of the procedure: Declaration of procedure always start with a keyword create ends with last variable parameters.
  • Body of the procedure: Body of procedure starts with a keyword called is or as and ends with end statement.

Syntax

create or replace procedure proc_name [list of parameters] 
is    
   Declaration section 
begin    
   Execution section 
Exception    
  Exception section 
end; 

Example of procedure

create or replace procedure p1(a in number, b out number, c out number, d out number)
is
begin;
select ename, sal, deptno, into b, c, d from emp
where empno=a;
end;

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements