Overview

更新时间:
复制 MD 格式

A stored procedure is a set of SQL statements designed to perform a specific task. It is stored in the database and compiled once for repeated use.

Functions and stored procedures are similar. Both are collections of SQL scripts. However, they have the following key differences:

  • Functions must return a single value, while stored procedures do not have a return value.

  • Functions can be embedded in SQL statements. For example, you can call a function in a SELECT statement. Stored procedures, however, are usually executed as separate units.

  • Functions have more restrictions than stored procedures. Generally, stored procedures can handle more complex tasks, while functions are designed for more specific purposes.

In OceanBase Developer Center (ODC), click a connection name to open it. In the left-side navigation bar, click the Stored Procedures tab to view the list of stored procedures. In the list, double-click the name of a stored procedure to open its management page. On this page, you can view the basic information, parameters, and Data Definition Language (DDL) of the stored procedure.

The database version requirements are as follows:

Database

Version

OceanBase Database in Oracle mode

V2.0.0 or later.

OceanBase Database in MySQL mode

V2.0.0 or later.

This section describes the following operations on stored procedure objects in ODC: