All Downloads are FREE. Search and download functionalities are using the official Maven repository.

antlr_supported_sql.oracle.ddl.create.xml Maven / Gradle / Ivy

There is a newer version: 3.1.0
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<sql-cases db-types="Oracle" namespace="oracle.ddl.create">
    <!-- -->
    <sql-case id="create_table" value="CREATE TABLE t_order (order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />
    <sql-case id="create_table_with_space" value="    CREATE TABLE t_order_item (
        item_id NUMBER(10),
        order_id NUMBER(10),
        user_id NUMBER(10),
        status VARCHAR2(10),
        column1 VARCHAR2(10),
        column2 VARCHAR2(10),
        column3 VARCHAR2(10)
    )"     />
    <sql-case id="create_table_with_quota" value="CREATE TABLE &quot;t_order&quot; (&quot;order_id&quot; NUMBER(10), &quot;user_id&quot; NUMBER(10), &quot;status&quot; VARCHAR2(10), &quot;column1&quot; VARCHAR2(10), &quot;column2&quot; VARCHAR2(10), &quot;column3&quot; VARCHAR2(10))" />
    <sql-case id="create_global_temporary_table" value="CREATE GLOBAL TEMPORARY TABLE t_order (order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />

    <sql-case id="create_table_with_column_not_null" value="CREATE TABLE t_order (order_id NUMBER(10) NOT NULL, user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />
    <sql-case id="create_table_with_column_default" value="CREATE TABLE t_order (order_id NUMBER(10) DEFAULT ON NULL 0, user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />
    <sql-case id="create_table_with_column_increment" value="CREATE TABLE t_order (order_id NUMBER(10) GENERATED BY DEFAULT AS IDENTITY START WITH 1 MAXVALUE 100, user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />
    <sql-case id="create_table_with_column_encrypt" value="CREATE TABLE t_order (order_id NUMBER(10) ENCRYPT USING 'encrypt_algorithm' IDENTIFIED BY '123456', user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />

    <sql-case id="create_table_with_inline_primary_key" value="CREATE TABLE t_order (order_id NUMBER(10) CONSTRAINT pk_order_id PRIMARY KEY, user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />
    <sql-case id="create_table_with_inline_unique_key" value="CREATE TABLE t_order (order_id NUMBER(10) CONSTRAINT uk_order_id UNIQUE, user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />
    <sql-case id="create_table_with_inline_foreign_key" value="CREATE TABLE t_order_item (item_id NUMBER(10), order_id NUMBER(10) CONSTRAINT fk_order_id REFERENCES t_order (order_id) ON DELETE CASCADE, user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />
    <sql-case id="create_table_with_inline_check" value="CREATE TABLE t_order (order_id NUMBER(10) CONSTRAINT chk_order_id CHECK (order_id > 0), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />
    <sql-case id="create_table_with_inline_constraints" value="CREATE TABLE t_order_item (item_id NUMBER(10) PRIMARY KEY UNIQUE NOT NULL CHECK (order_id > 0), order_id NUMBER(10) CONSTRAINT fk_order_id REFERENCES t_order (order_id) ON DELETE CASCADE, user_id NUMBER(10), status VARCHAR2(10) NULL, column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />

    <sql-case id="create_table_with_out_of_line_primary_key" value="CREATE TABLE t_order (order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10), CONSTRAINT pk_order_id PRIMARY KEY (order_id))" />
    <sql-case id="create_table_with_out_of_line_composite_primary_key" value="CREATE TABLE t_order (order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10), CONSTRAINT pk_order_id_user_id_status PRIMARY KEY (order_id, user_id, status))" />
    <sql-case id="create_table_with_out_of_line_unique_key" value="CREATE TABLE t_order (order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10), CONSTRAINT uk_order_id UNIQUE (order_id))" />
    <sql-case id="create_table_with_out_of_line_composite_unique_key" value="CREATE TABLE t_order (order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10), CONSTRAINT uk_order_id UNIQUE (order_id, user_id, status))" />
    <sql-case id="create_table_with_out_of_line_foreign_key" value="CREATE TABLE t_order_item (item_id NUMBER(10), order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10), CONSTRAINT fk_order_id FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON DELETE CASCADE)" />
    <sql-case id="create_table_with_out_of_line_composite_foreign_key" value="CREATE TABLE t_order_item (item_id NUMBER(10), order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10), CONSTRAINT fk_order_id FOREIGN KEY (order_id, user_id, status) REFERENCES t_order (order_id, user_id, status) ON DELETE CASCADE)" />
    <sql-case id="create_table_with_out_of_line_check" value="CREATE TABLE t_order (order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10), CONSTRAINT chk_order_id CHECK (order_id > 0))" />
    <sql-case id="create_table_with_out_of_line_constraints" value="CREATE TABLE t_order_item (item_id NUMBER(10), order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10), PRIMARY KEY (item_id), UNIQUE (item_id), FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON DELETE CASCADE), CHECK (item_id > 0))" />

    <sql-case id="create_table_with_exist_index" value="CREATE TABLE t_order (order_id NUMBER(10) PRIMARY KEY USING INDEX idx_order_id, user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />
    <sql-case id="create_table_with_create_index" value="CREATE TABLE t_order (order_id NUMBER(10) PRIMARY KEY USING INDEX (CREATE INDEX idx_order_id ON t_order (order_id)), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" />

    <sql-case id="create_table_with_partition" value="CREATE TABLE t_order (order_id NUMBER(10), user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10)) PARTITION BY HASH (order_id) PARTITIONS 2" />

    <!--  
    <sql-case id="create_table_with_select" value="CREATE TABLE t_order_bak AS SELECT * FROM t_order" />
    -->
    
    <sql-case id="create_index" value="CREATE INDEX idx_order_id ON t_order (order_id)" />
    <sql-case id="create_index_with_space" value="    CREATE INDEX
        idx_order_id
    ON
        t_order (order_id)    " />
    <sql-case id="create_index_with_quota" value="CREATE INDEX &quot;idx_order_id&quot; ON &quot;t_order&quot; (&quot;order_id&quot;)" />
    <sql-case id="create_composite_index" value="CREATE INDEX idx_order_id_user_id_status ON t_order (order_id, user_id, status)" />
    <sql-case id="create_unique_index" value="CREATE UNIQUE INDEX uk_order_id ON t_order (order_id)" />
    <sql-case id="create_index_with_function" value="CREATE INDEX idx_upper_status ON t_order (UPPER(status))" />
</sql-cases>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy