This topic describes the conversion scope of CREATE TABLE DDL operations for defining virtual columns during data migration from an Oracle database to the Oracle compatible mode of OceanBase Database.
Syntax
virtual_column_definition:
column [ datatype [ COLLATE column_collation_name ] ]
[ VISIBLE | INVISIBLE ]
[ GENERATED ALWAYS ] AS (column_expression) [ VIRTUAL ]
[ evaluation_edition_clause ] [ unusable_editions_clause ]
[ inline_constraint [ inline_constraint ]... ]
evaluation_edition_clause:
EVALUATE USING { CURRENT EDITION | EDITION edition | NULL EDITION }
unusable_editions_clause:
[ UNUSABLE BEFORE { CURRENT EDITION | EDITION edition } ]
[ UNUSABLE BEGINNING WITH { CURRENT EDITION | EDITION edition | NULL EDITION } ]
Supported operations
Defining column types by using the
column_name datatypeclause is supported.Specifying the column visibility attribute by using the
VISIBLE | INVISIBLEclause is supported. The default value is VISIBLE, which is not declared.Defining inline constraints by using the
inline_constraintoption is supported. For more information, see Constraints.Defining virtual columns by using the
GENERATED ALWAYS AS column_expressionandcolumn datatype AS column_expressionoptions is supported. Here is the sample code:Notice
Defining virtual columns by using the
GENERATED ALWAYS AS identityoption is not supported. OMS ignores the option during schema migration and migrates only the field names and type definitions.CREATE TABLE T (C1 CHAR, C2 CHAR GENERATED ALWAYS AS (SUBSTR(C1,1,2))); CREATE TABLE T (C1 CHAR, C2 CHAR AS (SUBSTR(C1,1,2)));
Ignored clauses and options
Note
The following clauses and options will be ignored and will not be resolved or converted when they are specified in the synchronized DDL statements.
The
COLLATE column_collation_nameclause for defining the column collation.The
evaluation_edition_clauseclause for specifying the version of a PL/SQL function. The Resolver searches for functions of the specified version during name resolution.The
unusable_editions_clauseclause for marking one or more versions of a query unusable by specifying the virtual column expression that cannot be used for query evaluation.