pl sql procedures,
procedures in pl sql, pl sql procedures examples, procedures and functions in
pl sql, procedures in pl sql with
examples, procedures in pl sql examples, Procedures in java, Procedures in
JDBC
Procedure
Procedure can
return any number of values (zero or more), but function exactly return only
single value.
Syntax to Create Procedure :
Create or replace procedure procedure_name(params if nay)
Is
Variable
declaration;
Begin
Statements;
End;
While creating the procedure we can pass three types of
parameters for procedure
1)
IN Parameter -->
Used for accepting input values
2)
OUT Parameter-->
Used for accepting output values
3)
IN OUT Parameter-->
Used for accepting both input & output values
Example to Create
Procedure :
Sql> ed test1
Then Notepad is opens
Create or replace procedure EXP(eno in number, exp out
number)
Is
D1 date;
D2 date;
Begin
Select hiredate into d1 from EMP where empno=eno;
Select sysdate into d2 from dual;
Exp:=(d2-d1)/365;
End;
Execution of
procedure :
Sql> @ test1
11/
Procedure created.\
No comments:
Post a Comment