Difference Between Stored Procedure and Function
Difference Between Stored Procedure and Function
Stored Procedures:
- A stored procedure is a set of SQL statements that can perform a task or execute a series of
actions.
- It does not necessarily return a value but can perform modifications to the database, execute
multiple operations,
Stored Functions:
- It is primarily used to perform computations and return results. Functions cannot make
- Functions are often invoked within SQL statements, including SELECT queries.
IN Parameters:
- IN parameters are used to pass values into the stored procedure, allowing it to use these inputs
- They are read-only, meaning they cannot be modified within the procedure; the value of the
- OUT parameters are used to return values from the stored procedure to the caller.
- They are writable within the procedure, allowing the stored procedure to assign a value that can
be accessed after
Stored Procedure:
Stored Function:
- A stored function is usually invoked within a SQL statement, such as SELECT, where it can