Chapter 15: Calling and Creating Stored Functions and Procedures
SQL is a declarative language, but it also has procedural features such as stored functions/procedures, triggers, and cursors, which means SQL is considered to be a Fourth-Generation Programming Language (4GL). In this chapter, we will see how to call and create stored functions/procedures, or in other words, how to call and create Persistent Stored Modules (SQL/PSM) for MySQL, PostgreSQL, SQL Server, and Oracle.
Just in case you need a quick reminder about the key differences between the stored procedures and functions, check out the following head-to-head table (some of these differences are entirely or partially true depending on the database):
As you can infer from the previous comparison, the main difference is that procedures (may) produce a side effect, whereas functions are (generally) expected not to.
So, our...