SQL-ProceduresFunctions-Page21

                                                                                        

           

👉What are Procedures/Functions?

A procedure or function is a logically grouped set of SQL and PL/SQL statements that perform a specific task.


A stored procedure or function is a named PL/SQL code block that has been compiled and stored in one of the Oracle engine's system tables.


If an error occurs during the compilation of the procedure or function, Oracle engine displays the error message.


The Oracle engine performs the following steps to execute a procedure or function:

1)Verifies user access

2)Verifies procedure or function validity

3)Executes the procedure or function


👉Procedures versus Functions?

A function must return a value back to the called. A function can return only one value to the calling PL/SQL code block.


By defining multiple OUT parameters in a procedure, multiple values can be passed to the caller. The OUT variable being global by nature, its value is accessible by any PL/SQL code block including the PL/SQL block via which it was called. 




👉Deleting a stored procedure or function

Drop Procedure dbo.InsertPatientDetails;

Drop Function f_GetMaxNo;



Comments

Popular posts from this blog

SQL-ForeignKeyConstraint-Page6

Javascript-OOPs(Part3)-Inheritance - (9)

Javascript-Unobtrusive - (6)