In OceanBase Database in MySQL mode, PL stored programs include stored procedures, stored functions, and triggers.
In OceanBase Database in MySQL mode, PL stored programs include the following types of objects:
Stored procedure: A stored procedure is created by using the
CREATE PROCEDUREstatement and is called by using theCALLstatement. A stored procedure does not return a value, but can have output parameters and generate a result set to return to the client program.Stored function: A stored function is created by using the
CREATE FUNCTIONstatement. Its usage is similar to that of a built-in function. You can call a stored function in an expression and return a value during the evaluation of the expression.Trigger: A trigger is created by using the
CREATE TRIGGERstatement and is associated with a table. Operations such as insertions and updates on the table can activate the trigger.
Stored procedures and functions are stored routines. Stored routines and triggers are stored programs.
Each stored program has a body consisting of multiple SQL statements, which can be separated by semicolons (;). The body of a stored procedure starts with the BEGIN keyword and ends with the END; keyword.
