Overview of stored programs
The PL stored programs in seekdb include stored procedures, stored functions, and triggers.
The PL stored objects in seekdb include the following object types:
-
Stored procedure: This object is created by using the
CREATE PROCEDUREstatement and called by using theCALLstatement. A stored procedure does not return a value, but can have output parameters and can generate a result set to return to the client program. -
Stored function: This object is created by using the
CREATE FUNCTIONstatement. It is used similarly to built-in functions. You can call a stored function in an expression and return a value during the evaluation of the expression. -
Trigger: This object is created by using the
CREATE TRIGGERstatement and associated with a table. Operations such as insertions and updates on the table can activate the trigger.
Stored procedures and functions are stored routines, and stored routines and triggers are stored programs.
The body of each stored program consists of multiple SQL statements separated by semicolons (;). The body of a stored procedure starts with the BEGIN keyword and ends with the END; keyword.