PL static SQL allows you to directly use SQL syntax in PL statements.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Generally, PL static SQL statements have the same syntax as the corresponding SQL statements:
SELECT(also known as a query)Data Manipulation Language (DML) statements:
INSERT,UPDATE,DELETE, andMERGE.Transaction Control Language (TCL) statements:
COMMIT,ROLLBACK,SAVEPOINT,SET TRANSACTION, andLOCK TABLE.
Pseudocolumns behave like table columns but are not stored in tables. Static SQL includes the following SQL pseudocolumns:
CURRVALandNEXTVALLEVELOBJECT_VALUEROWIDROWNUM
OceanBase Database supports returning complex data types from SQL statements in the following scenarios:
SELECT INTOandBULK INTORETURNING INTOandBULK INTOin DML statementsFETCH INTOandBULK INTO
Notice
Starting from OceanBase Database V4.2.0, you can import multiple columns of data into a variable of the RECORD type by using the `INTO` clause. You can also import multiple columns of data into multiple variables of the OBJECT type by using the `BULK INTO` clause.
