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 Function in the left-side navigation pane to get a list of functions. To create a function, click + in the upper-right corner of the function list or click Create in the navigation bar on the top of the page. The following table describes the parameters that you need to specify to create a function.
| Parameter | Description |
|---|---|
| Function Name | Specifies the name of the function. |
| Return Type | Specifies the data type of the return value. |
| Parameter | Specifies the information passed to the function when the function is called. You must specify Name , Mode , Data Type , and Default Value for a parameter. The Default Value and Mode settings are unavailable in MySQL mode. You can drag the parameters to reorder them. |
You need to specify Mode for a parameter to indicate its type. The parameter mode setting is unavailable in MySQL mode. The Oracle mode supports the following parameter modes: IN , OUT , and INOUT .
IN : indicates an input parameter. When a function is called, the input parameter is passed to the function and used in the execution of the function.
OUT : indicates an output parameter. When a function is called, the value of the output parameters is ignored and an empty value is passed to the function. The output parameter in the function body can be modified. The modified result is returned and passed to the actual parameter that the output parameter represents.
INOUT : indicates an inout parameter. An inout parameter has the features of both an input parameter and an output parameter.
