SnowConvert AI - Oracle - Create Table¶
In this section you could find information about TABLES, their syntax and current conversions.
説明¶
Oracleでは、CREATE TABLE ステートメントを使用して、ユーザーデータを保持する基本構造であるリレーショナルテーブル、または列定義にオブジェクト型を使用するテーブルであるオブジェクトテーブルのいずれかのタイプのテーブルを作成します。(Oracleドキュメント)
Oracle構文
Snowflake構文
注釈
Snowflakeの詳細情報については、以下の ドキュメント を参照してください。
サンプルソースパターン¶
2.1.物理的プロパティとテーブルプロパティ¶
Oracle¶
Snowflake¶
注釈
テーブルプロパティは、Snowflakeでの移行後には必要ないため、削除されています。
2.2.制約と制約状態¶
CHECK Constraints¶
Snowflake supports CHECK constraints with deterministic, scalar expressions. Oracle-specific state clauses (DEFERRABLE, RELY, INITIALLY, ENABLE, DISABLE) are removed during conversion with SSC-FDM-0046 annotations. CHECK constraints with unsupported expressions (UDFs, non-deterministic functions) are flagged with SSC-EWI-0116.
Supported:
Basic CHECK constraints with scalar, deterministic expressions
Column-level and table-level CHECK constraints
Named and unnamed constraints
Removed automatically (with SSC-FDM-0046):
[NOT] DEFERRABLE- Snowflake always validates immediately[NOT] RELY- Optimizer hint not supportedINITIALLY IMMEDIATE/INITIALLY DEFERREDENABLE/DISABLE- Snowflake constraints are always enforced
Unsupported (flagged with SSC-EWI-0116):
User-defined functions (UDFs)
Non-deterministic built-in functions
Context-dependent functions
Subqueries
Example 1: Basic CHECK Constraint¶
Oracle¶
Snowflake¶
Example 2: CHECK Constraint with NOT DEFERRABLE (Removed)¶
The NOT DEFERRABLE clause is removed with SSC-FDM-0046 because Snowflake always validates CHECK constraints immediately.
Oracle¶
Snowflake¶
Example 3: CHECK Constraint with RELY Clause (Removed)¶
Oracle¶
Snowflake¶
Example 4: CHECK Constraint with Unresolved Function (Unsupported)¶
When a CHECK constraint references a function that cannot be resolved, it is flagged with SSC-EWI-0116 as a user-defined function.
Oracle¶
Snowflake¶
注釈
The USING INDEX constraint clause is entirely removed from the output code during the conversion.
NOT NULL Constraint States¶
In case you have any constraint state after a NOT NULL constraint as follows:
RELYNO RELYRELY ENABLERELY DISABLEVALIDATENOVALIDATE
これらもコメントアウトされます。
注釈
ENABLE の制約状態は、変換処理中に出力コードから完全に削除されます。DISABLE 状態の場合、NOT NULL 制約と同時に削除されます。
Oracle¶
Snowflake¶
2.3.外部キー¶
精度もスケールもない NUMBER 列を持つテーブルと、前述の NUMBER 列を参照する NUMBER(*,0)列を持つ別のテーブルがある場合、この外部キーをコメントアウトします。
Oracle¶
Snowflake¶
2.4.仮想列¶
Oracle¶
Snowflake¶
2.5.アイデンティティ列¶
アイデンティティ列の場合、シーケンスが作成され、列に割り当てられます。
Oracle¶
Snowflake¶
2.6.CLOB および BLOB 列宣言¶
CLOB または BLOB として宣言された列は、VARCHAR に変更されます。
Oracle¶
Snowflake¶
2.7.制約名¶
警告
制約名はSnowflakeでは適用できないため、コードから削除されています。
Oracle¶
Snowflake¶
2.8.時刻を含むデフォルト列¶
日付型として宣言された列は、特定の日付型と一致するようにキャストされます。
Oracle¶
Snowflake¶
2.10 AS SubQuery¶
Snowflakeで AS SubQuery を通じてテーブルを作成する場合、以下のプロパティと句はサポートされません。
Oracle¶
Snowflake¶
既知の問題¶
Snowflakeでの動作が異なるため、テーブルのプロパティの一部を適応したり、コメントしたりする場合があります。