PL static SQL supports direct use of SQL syntax in PL statements.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Generally, PL static SQL statements use the same syntax as the following SQL statements:
SELECTstatement, which is also referred to as a query.Data manipulation language (DML) statements:
INSERT,UPDATE,DELETE, andMERGE.Transaction control language (TCL) statements:
COMMIT,ROLLBACK,SAVEPOINT,SET TRANSACTION, andLOCK TABLE.
A pseudocolumn acts like a normal column, but is not stored in a table. Static SQL supports the following SQL pseudocolumns:
CURRVALandNEXTVALLEVELOBJECT_VALUEROWIDROWNUM
In OceanBase Database, PL static SQL supports complex data types for return values of SQL statements in the following scenarios:
SELECT INTO/BULK INTORETURING INTO/BULK INTOin DML statementsFETCH INTO/BULK INTO
Notice
OceanBase Database V4.2.0 and later allow you to import data of multiple columns into a single RECORD variable by using the SELECT INTO statement or into multiple OBJECT variables by using the BULK INTO statement.