Stored Procedure
1. When we have to same task everyday then instead of writing queries we can save the query in procedure and then just run it when required.
2. Named PLSQL program
3. Permanently saved in DB
Features :
1. Procedures executed explicitly. Execute Command
Exec Procedurename (arg1, arg2...);
2. Procedures can also executed implicitly. Using procedured calling statement
Procedurename(arg1, arge2...);
3. Saved in a DB as pre compiled obbject. Complied once only when there is changes in logic of SP then again it will complied.
Can call procedure from other proc, func, programs.
4. Procedure can be static or dynamic mean proc may or maynot take arguments.
5. By default proc should not return any value.
Types of Proc:
1. Static : Not having arg
2. Dynamic : With arg
Syntax :
Create or replace procedure procedure_name( arguments ..)
is/as ----------any keyword use
declaration -----declare variables
Begin
execution statements....
end;
Comments
Post a Comment