May 2020
Beginner
564 pages
14h 9m
English
A function differs from a stored procedure in many ways, as shown in the following table:
|
Function |
Stored procedure |
|
Returns only one mandatory value |
Can return zero, one, or multiple values |
|
Doesn't allow transactions |
Allow transactions |
|
Can be used in SELECT, WHERE, and HAVING clauses |
Can't be used in SELECT, WHERE, and HAVING clauses |
|
Only allows input parameters |
Allows input and output parameters |
|
Can't use error handling |
Can use error handling |
Each is powerful in their own way, and you need to keep in mind how each works to ensure you choose the right one for your use case. Generally speaking, a function is used to compute a ...
Read now
Unlock full access