In a database system, a stored procedure is a collection of SQL statements for implementing a specific action. A stored procedure is stored in the database, and can be reused after it is compiled.
Functions and stored procedures are similar in definition. Both are a collection of SQL statements. They have the following differences:
A function normally returns a value, whereas a stored procedure does not return values.
You can embed a function in an SQL statement. For example, you can call a function in a
SELECTstatement. However, usually a stored procedure is independently executed.Functions have more limits than stored procedures. In general, stored procedures implement more complex features, whereas a function implements a more specific feature.
Log on to OceanBase Developer Center (ODC) and click the name of the target connection to go to the corresponding connection management page. You can click Stored Procedure in the left-side navigation pane to get a list of stored procedures. In the stored procedure list, you can double-click the name of a stored procedure to go to the stored procedure management page, where you can view the basic information, parameters, and data definition language (DDL) statements of the stored procedure.
The database version must meet the following requirements:
| Database | Version |
|---|---|
| OceanBase Database in Oracle mode | V2.0.0 or a later version |
| OceanBase Database in MySQL mode | V2.0.0 or a later version |
This chapter describes in different topics the operations you can perform on stored procedure objects in ODC.