Chapter 14. Procedures, Functions, and Blocks
Beginner
Q: | ||||||||||||||||
14-1. | A procedure executes one or more statements and then terminates. A function executes one or more statements and then returns a result via the RETURN statement. | |||||||||||||||
Q: | ||||||||||||||||
14-2. | Procedures and functions are composed of the following four sections:
| |||||||||||||||
Q: | ||||||||||||||||
14-3. | Use the RETURN statement to return a value from a function. It has the following format: RETURN where expression is a literal, variable, or complex expression whose datatype matches (or can be converted to) the datatype in the function’s header’s RETURN clause. You can use RETURN inside a procedure, but you may not specify data to be returned. Instead you simply state: RETURN; The procedure immediately terminates and returns control to the enclosing block. You should avoid using RETURN in a procedure, however, because it leads to unstructured code that is hard to read ... |
Get Oracle PL/SQL Programming: A Developer's Workbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.