This topic describes the restrictions on SQL writing in OceanBase Database.
For a table with a primary key, the following rules must be met:
A table can have at most one primary key column set.
The primary key value cannot be NULL or an empty string.
The value of the primary key cannot be changed.
The number of primary key columns cannot exceed 64.
The total length of the primary key data cannot exceed 16 KB.
When creating a VARCHAR or VARCHAR2 column, you must specify the maximum column length, which must be at least 1 byte.
The NUMBER type is a variable-length, precise numeric type that occupies 4 to 40 bytes of storage space. It can store zero, floating-point numbers, positive and negative fixed-point numbers. The NUMBER type has good data precision, strong portability, and strong universality. However, its computational efficiency is relatively lower than that of the floating-point type.
When referencing attributes and methods of an object type:
To reference the attributes or methods of an object type in an SQL statement, you must use a table alias to fully qualify the reference.
To reference a member method that does not accept parameters, you must provide empty parentheses.
When using partition extension and subpartition extension to specify table names, the following restrictions apply:
If the name does not contain a remote table: The extended partition table name and subpartition extended table name cannot contain database links or synonyms that can be converted into tables with database links.
If the name does not contain a synonym: You must use the base table to specify the partition or subpartition extension name. You cannot use synonyms, views, or any other objects.
In the PARTITION FOR and SUBPARTITION FOR clauses, you cannot specify the keywords DEFAULT or MAXVALUE, or bind variables as partition_key_value or subpartition_key_value.
In the PARTITION and SUBPARTITION clauses, you cannot specify bind variables for the partition or subpartition name.
You cannot perform any write operations (DML or DDL operations) on objects in the recycle bin. You can only perform read-only operations (SELECT).
The SELECT...FOR UPDATE SKIP LOCKED statement only supports single-table queries.
