Skip to content

Grammar railroad diagram #7

Open
@mingodad

Description

@mingodad

Using this tool https://github.com/GuntherRademacher/ebnf-convert with oracle.pegjs after fixing the parts not recognized by ebnf-convert we can get an EBNF understood by https://github.com/GuntherRademacher/rr to generate a nice navigable railroad diagram (see bellow with instructions at the top).
I hope it can help document/develop/debug the grammar.

//
// EBNF to be viewd at
//    (IPV6) https://www.bottlecaps.de/rr/ui
//    (IPV4) https://rr.red-dove.com/ui
//
// Copy and paste this at one of the urls shown above in the 'Edit Grammar' tab
// then click the 'View Diagram' tab.
//

/* converted on Wed Apr 9, 2025, 11:18 (UTC+02) by pegjs-to-w3c v0.69 which is Copyright (c) 2011-2025 by Gunther Rademacher <[email protected]> */

start    ::= ( _ stmt _ )*
stmt     ::= create_table_stmt
           | drop_table_stmt
           | alter_table_stmt
           | create_domain_stmt
           | drop_domain_stmt
           | commit_stmt
           | create_sequence_stmt
           | alter_sequence_stmt
           | drop_sequence_stmt
           | create_index_stmt
           | drop_index_stmt
drop_index_stmt
         ::= 'drop' _ 'index' _ if_exists? _ schema_object _ 'online'? 'force'? ( ( 'deferred' | 'immediate' ) _ 'invalidation' )? _ ';'
create_index_stmt
         ::= 'create' _ ( 'unique' | 'bitmap' | 'multivalue' )? _ 'index' _ if_not_exists? _ schema_object _ 'on' _ table_index_clause _ ( 'usable' | 'unusable' )? _ ( ( 'deferred' | 'immediate' ) _ 'invalidation' )? _ ';'
table_index_clause
         ::= schema_object _ identifier_name? _ '(' _ table_index_columns _ ')'
table_index_columns
         ::= table_index_column _ ( ',' _ table_index_column )*
table_index_column
         ::= identifier_name _ ( 'asc' | 'desc' )?
drop_sequence_stmt
         ::= 'drop' _ 'sequence' _ if_exists? _ schema_object _ ';'
alter_sequence_stmt
         ::= 'alter' _ 'sequence' _ if_exists? _ schema_object _ sequence_settings? _ ';'
create_sequence_stmt
         ::= 'create' _ 'sequence' _ if_not_exists? _ schema_object _ sharing_clause? _ sequence_settings? _ ';'
sequence_settings
         ::= ( ( increment_clause | maxvalue_clause | minvalue_clause | cycle_clause | cache_clause | order_clause | keep_clause | scale_clause | 'session' | 'global' ) _ )*
scale_clause
         ::= 'scale' _ ( 'extend' | 'noextend' )
           | 'noscale'
shared_clause
         ::= 'shared' _ ( 'extend' | 'noextend' )
           | 'noshared'
commit_stmt
         ::= 'commit' _ 'work'? _ ( 'force' _ string _ ( ',' _ integer )? | 'comment' _ string _ ( ( 'wait' | 'nowait' )? _ ( 'batch' | 'immediate' )? )? )? _ ';'
drop_domain_stmt
         ::= 'drop' _ 'usecase'? _ 'domain' _ if_exists? _ schema_object _ ( 'force' _ 'preserve'? )? _ ';'
if_exists
         ::= 'if' _ 'exists'
create_domain_stmt
         ::= create_single_column_domain
create_single_column_domain
         ::= 'create' _ 'usecase'? _ 'domain' _ if_not_exists? _ schema_object _ 'as' _ ( data_type | enum ) _ ';'
enum     ::= 'enum' _ '(' _ enum_list _ ')'
enum_list
         ::= enum_item_list _ ( ',' _ enum_item_list )*
enum_item_list
         ::= identifier_name _ enum_alias_list? _ ( '=' _ literal )?
enum_alias_list
         ::= identifier_name _ enum_item_list
if_not_exists
         ::= 'if' _ 'not' _ 'exists'
create_table_stmt
         ::= 'create' _ 'table' _ table_type? _ schema_object _ sharing_clause? ( relational_table | object_table | XMLType_table ) table_memoptimize_clauses? _ table_parent_clause? _ ';'
table_type
         ::= ( 'global' | 'private' ) _ 'temporary'
           | 'shared'
           | 'duplicated'
           | 'immutable'? _ 'blockchain'
           | 'immutable'
sharing_clause
         ::= 'sharing' _ '=' _ ( 'metadata' | ( 'extended' _ )? 'data' | 'none' )
table_memoptimize_clauses
         ::= ( table_memoptimize_clause _ )*
table_memoptimize_clause
         ::= 'memoptimize' _ 'for' _ ( 'read' | 'write' )
table_parent_clause
         ::= 'parent' _ schema_object
relational_table
         ::= ( '(' _ relational_properties _ ')' )? blockchain_table_clauses? _ immutable_table_clauses? _ default_collation_clause? _ ( 'on' _ 'commit' _ ( 'drop' | 'preserve' ) _ 'definition' )? _ ( 'on' _ 'commit' _ ( 'drop' | 'preserve' ) _ 'rows' )? _ physical_properties? _ table_properties?
table_properties
         ::= column_properties? _ read_only_clause? _ indexing_clause? _ table_partitioning_clauses? _ attribute_clusering_clause? _ ( 'cache' | 'nocache' )? _ result_cache_clause? _ parallel_clause? _ ( 'norowdependencies' | 'rowdependencies' )? _ enable_disable_clause? _ row_movement_clause? _ logical_replication_clause? _ flashback_archive_clause? _ ( 'row' _ 'archival' )? _ ( 'as' _ subquery | 'for' _ 'exchange' _ 'with' _ 'table' _ identifier_name _ '.' _ identifier_name )?
flashback_archive_clause
         ::= 'flashback' _ 'archive' _ identifier_name?
           | 'no' _ 'flashback' _ 'archive'
logical_replication_clause
         ::= 'disable' _ 'logical' _ 'replication'
           | 'enable' _ 'logical' _ 'replication' _ ( ( 'all' | 'allow' _ 'novalidate' ) _ 'keys' )?
row_movement_clause
         ::= ( 'enable' | 'disable' ) _ 'row' _ 'movement'
enable_disable_clause
         ::= ( 'enable' | 'disable' ) _ ( 'validate' | 'novalidate' )? _ ( 'unique' _ '(' _ comma_separated_identifiers _ ')' | 'primary' _ 'key' | 'constraint' _ identifier_name ) _ using_index_clause? _ exception_clause? _ 'cascade'? _ ( ( 'drop' | 'keep' ) _ 'index' )?
parallel_clause
         ::= 'noparallel'
           | 'parallel' _ integer?
result_cache_clause
         ::= 'result_cache' _ '(' _ ( ( 'mode' _ ( 'default' | 'force' ) )? _ _ ',' _ 'standby' _ ( 'enable' | 'disable' ) | 'standby' _ ( 'enable' | 'disable' ) _ _ ',' _ 'mode' _ ( 'default' | 'force' ) ) _ ')'
attribute_clusering_clause
         ::= 'clustering' _ clusering_join _ cluster_clause _ clustering_when? _ zonemap_clause?
zonemap_clause
         ::= 'with' _ 'materialized' _ 'zonemap' _ '(' _ identifier_name _ ')'
           | 'without' _ 'materialized' _ 'zonemap'
clustering_when
         ::= ( ( 'no' | 'yes' ) _ 'on' _ 'load' )? _ ( ( 'no' | 'yes' ) _ 'on' _ 'data' _ 'movement' )?
cluster_clause
         ::= 'by' _ ( 'linear' | 'interleaved' )? _ 'order' _ clustering_columns
clustering_columns
         ::= clustering_column_group
           | '(' _ clustering_column_group _ ( ',' _ clustering_column_group _ )* ')'
clustering_column_group
         ::= '(' _ comma_separated_identifiers _ ')'
clusering_join
         ::= schema_object _ clusering_join_stmts
clusering_join_stmts
         ::= clusering_join_stmt ( _ ',' _ clusering_join_stmt )*
clusering_join_stmt
         ::= 'join' _ schema_object _ 'on' _ '(' _ equijoin_condition _ ')'
equijoin_condition
         ::= schema_object _ '=' _ schema_object
schema_object
         ::= ( identifier_name _ '.' )? _ identifier_name
table_partitioning_clauses
         ::= range_partitions
           | list_partitions
           | hash_partitions
           | composite_range_partitions
           | composite_list_partitions
           | composite_hash_partitions
           | reference_partitioning
           | system_partitioning
           | consistent_hash_partitions
           | consistent_hash_with_subpartitions
           | partitionset_clauses
partitionset_clauses
         ::= range_partitionset_clause
           | list_partitionset_clause
list_partitionset_clause
         ::= 'partitionset' _ 'by' _ 'list' _ '(' _ comma_separated_identifiers _ ')' _ 'partition' _ 'by' _ 'consistent' _ 'hash' _ '(' _ comma_separated_identifiers _ ')' _ 'subpartition' _ 'by' _ ( ( 'range' | 'hash' ) _ '(' _ comma_separated_identifiers | 'list' _ '(' _ identifier_name ) _ ')' _ subpartition_template? _ 'partitions' _ 'auto' _ '(' _ list_partitionset_desc _ ( ',' _ list_partitionset_desc _ )* ')'
list_partitionset_desc
         ::= 'partitionset' _ identifier_name _ list_values_clause _ ( 'tablespace' _ 'set' _ identifier_name )? _ LOB_storage_clause? _ ( 'subpartitions' _ 'store' _ 'in' _ '(' _ comma_separated_identifiers _ ')' )?
range_partitionset_clause
         ::= 'partitionset' _ 'by' _ 'range' _ '(' _ comma_separated_identifiers _ ')' _ 'partition' _ 'by' _ 'consistent' _ 'hash' _ '(' _ comma_separated_identifiers _ ')' _ 'subpartition' _ 'by' _ ( ( 'range' | 'hash' ) _ '(' _ comma_separated_identifiers | 'list' _ '(' _ identifier_name ) _ ')' _ subpartition_template? _ 'partitions' _ 'auto' _ '(' _ range_partitionset_desc _ ( ',' _ range_partitionset_desc _ )* ')'
range_partitionset_desc
         ::= 'partitionset' _ identifier_name _ range_values_clause _ ( 'tablespace' _ 'set' _ identifier_name )? _ LOB_storage_clause? _ ( 'subpartitions' _ 'store' _ 'in' _ '(' _ comma_separated_identifiers _ ')' )?
consistent_hash_partitions
         ::= 'partition' _ 'by' _ 'consistent' _ 'hash' _ '(' _ comma_separated_identifiers _ ')' _ ( 'partitions' _ 'auto' )? _ 'tablespace' _ 'set' _ identifier_name
consistent_hash_with_subpartitions
         ::= 'partition' _ 'by' _ 'consistent' _ 'hash' _ '(' _ comma_separated_identifiers _ ')' _ subpartition _ ( 'partitions' _ 'auto' )?
composite_hash_partitions
         ::= 'partition' _ 'by' _ 'hash' _ '(' _ comma_separated_identifiers _ ')' _ subpartition _ ( individual_hash_partitions | hash_partitions_by_quantity )
composite_list_partitions
         ::= 'partition' _ 'by' _ 'list' _ '(' _ comma_separated_identifiers _ ')' _ ( 'automatic' _ ( 'store' _ 'in' _ '(' _ comma_separated_identifiers _ ')' )? )? _ '(' _ subpartition _ list_partition_descs
list_partition_descs
         ::= '(' _ list_partition_desc _ ',' _ list_partition_desc _ ')'
list_partition_desc
         ::= 'partition' _ identifier_name? _ list_values_clause _ table_partition_description _ ( integer | '(' _ ( list_subpartition_desc_arr | range_subpartition_desc_arr | individual_hash_subparts_arr ) _ ')' )?
composite_range_partitions
         ::= 'partition' _ 'by' _ 'range' _ '(' _ comma_separated_identifiers _ ')' _ ( 'interval' _ '(' _ expr _ ')' _ ( 'store' _ 'in' _ '(' _ comma_separated_identifiers _ ')' )? )? _ subpartition _ range_partition_descs
range_partition_descs
         ::= '(' _ range_partition_desc _ ',' _ range_partition_desc _ ')'
range_partition_desc
         ::= 'partition' _ identifier_name? _ range_values_clause _ table_partition_description _ ( integer | '(' _ ( list_subpartition_desc_arr | range_subpartition_desc_arr | individual_hash_subparts_arr ) _ ')' )?
subpartition
         ::= subpartition_by_range
           | subpartition_by_list
           | subpartition_by_hash
subpartition_by_hash
         ::= 'subpartition' _ 'by' _ 'hash' _ '(' _ comma_separated_identifiers _ ')' _ ( subpartition_template | 'subpartitions' _ integer _ ( 'store' _ 'in' _ '(' _ comma_separated_identifiers _ ')' )? )?
subpartition_by_range
         ::= 'subpartition' _ 'by' _ 'range' _ '(' _ comma_separated_identifiers _ ')' _ subpartition_template?
subpartition_by_list
         ::= 'subpartition' _ 'by' _ 'list' _ '(' _ comma_separated_identifiers _ ')' _ subpartition_template?
subpartition_template
         ::= 'subpartition' _ 'template' _ ( integer | '(' _ ( list_subpartition_desc_arr | range_subpartition_desc_arr | individual_hash_subparts_arr ) _ ')' )
range_subpartition_desc_arr
         ::= range_subpartition_desc ( _ ',' _ range_subpartition_desc )*
list_subpartition_desc_arr
         ::= list_subpartition_desc ( _ ',' _ list_subpartition_desc )*
individual_hash_subparts_arr
         ::= individual_hash_subparts ( _ ',' _ individual_hash_subparts )*
range_subpartition_desc
         ::= 'subpartition' _ identifier_name? _ range_values_clause _ read_only_clause? _ indexing_clause? _ partitioning_storage_clause? _ external_part_subpart_data_props?
list_subpartition_desc
         ::= 'subpartition' _ identifier_name? _ list_values_clause _ read_only_clause? _ indexing_clause? _ partitioning_storage_clause? _ external_part_subpart_data_props?
individual_hash_subparts
         ::= 'subpartition' _ identifier_name? _ read_only_clause? _ indexing_clause? _ partitioning_storage_clause? _
hash_partitions
         ::= 'partition' _ 'by' _ 'hash' _ '(' _ comma_separated_identifiers _ ')' _ ( individual_hash_partitions | hash_partitions_by_quantity )
individual_hash_partitions
         ::= '(' _ individual_hash_partition _ ( ',' _ individual_hash_partition _ )* ')'
individual_hash_partition
         ::= 'partition' _ identifier_name? _ read_only_clause? _ indexing_clause? _ partitioning_storage_clause? _
partitioning_storage_clause
         ::= ( _ partitioning_storage_options _ )*
partitioning_storage_options
         ::= inmemory_clause
           | LOB_partitioning_storage
           | ilm_clause
           | index_compression
           | table_compression
           | JSON_storage_clause
           | tablespace_or_tablespace_set
           | 'overflow' _ tablespace_or_tablespace_set?
           | 'varray' _ identifier_name _ 'store' _ 'as' _ ( 'securefile' | 'basicfile' )? _ 'lob' _ identifier_name
tablespace_or_tablespace_set
         ::= '(' _ 'tablespace' _ ( 'set' _ )? identifier_name _ ')'
index_compression
         ::= prefix_compression
           | advanced_index_compression
advanced_index_compression
         ::= 'compress' _ 'advanced' _ ( 'high' | 'low' )?
           | 'nocompress'
hash_partitions_by_quantity
         ::= 'partitions' _ integer _ ( 'store' _ 'in' _ '(' _ comma_separated_identifiers _ ')' )? _ ( table_compression | index_compression )? _ ( 'overflow' _ 'store' _ 'in' _ '(' _ comma_separated_identifiers _ ')' )?
list_partitions
         ::= 'partition' _ 'by' _ 'list' _ '(' _ comma_separated_identifiers _ ')' _ ( 'automatic' _ ( 'store' _ 'in' _ '(' _ comma_separated_identifiers _ ')' )? )? _ '(' _ list_partition _ ( ',' _ list_partition _ )* ')'
list_partition
         ::= 'partition' _ identifier_name? _ list_values_clause _ table_partition_description _ external_part_subpart_data_props? _
list_values_clause
         ::= 'values' _ '(' _ ( 'default' | list_values ) _ ')'
list_values_list
         ::= '(' _ list_values _ ')' ( _ ',' _ '(' _ list_values _ ')' )*
list_values
         ::= ( 'null' | literal ) ( _ ',' _ ( 'null' | literal ) )*
reference_partitioning
         ::= 'partition' _ 'by' _ 'reference' _ '(' _ identifier_name _ ( '(' _ reference_partition_desc _ ')' )?
system_partitioning
         ::= 'partition' _ 'by' _ 'system' _ ( 'partitions' _ integer | reference_partition_desc )?
reference_partition_desc
         ::= reference_partition_option ( _ ',' _ reference_partition_option )*
reference_partition_option
         ::= 'partition' _ identifier_name? _ table_partition_description?
range_partitions
         ::= 'partition' _ 'by' _ 'range' _ '(' _ comma_separated_identifiers _ ')' _ ( 'interval' _ '(' _ expr _ ')' _ ( 'store' _ 'in' _ '(' _ comma_separated_identifiers _ ')' )? )? _ '(' _ range_partition _ ( ',' _ range_partition _ )* ')'
range_partition
         ::= 'partition' _ identifier_name? _ range_values_clause _ table_partition_description _ external_part_subpart_data_props? _
external_part_subpart_data_props
         ::= ( 'default' _ 'directory' identifier_name )? _ ( 'location' _ '(' _ external_table_data_prop_dirs _ ')' )?
table_partition_description
         ::= ( 'internal' | 'external' )? _ deferred_segment_creation? _ read_only_clause? _ indexing_clause? _ segment_attributes_clause? _ ( table_compression | prefix_compression )? _ inmemory_clause? _ ilm_clause? _ ( 'overflow' _ segment_attributes_clause? )? _ table_partition_description_props?
table_partition_description_props
         ::= ( _ table_partition_description_prop _ )+
table_partition_description_prop
         ::= JSON_storage_clause
           | LOB_storage_clause
           | varray_col_properties
           | nested_table_col_properties
inmemory_clause
         ::= 'no' _ 'inmemory'
           | 'inmemory' _ inmemory_attributes? _ ( comma_separated_identifiers | inmemory_col_policy ( _ ',' _ inmemory_col_policy )* )
inmemory_col_policy
         ::= identifier_name _ 'using' _ identifier_name
range_values_clause
         ::= 'values' _ 'less' _ 'than' _ '(' _ range_value _ ( ',' _ range_value _ )* ')'
range_value
         ::= 'maxvalue'
           | literal
read_only_clause
         ::= 'read' _ ( 'only' | 'write' )
indexing_clause
         ::= 'indexing' _ ( 'on' | 'off' )
column_properties
         ::= ( _ column_property )+
column_property
         ::= object_type_col_properties
           | nested_table_col_properties
           | JSON_storage_clause
           | ( varray_col_properties | LOB_storage_clause ) ( _ '(' _ LOB_partition_storage _ ( ',' _ LOB_partition_storage _ )* ')' )?
LOB_partition_storage
         ::= 'partition' _ identifier_name _ _ ( ( varray_col_properties | LOB_storage_clause ) _ )+ ( '(' _ 'subpartition' _ identifier_name _ _ ( ( varray_col_properties | LOB_partitioning_storage ) _ )+ ')' )?
LOB_partitioning_storage
         ::= 'lob' _ '(' _ identifier_name _ '(' _ 'store' _ 'as' ( 'basicfile' | 'securefile' )? _ ( identifier_name _ )? tablespace_or_tablespace_set?
LOB_storage_clause
         ::= 'lob' _ '(' _ ( comma_separated_identifiers _ ')' _ 'store' _ 'as' _ LOB_storage_store_as_wo_segname | identifier_name _ ')' _ 'store' _ 'as' _ LOB_storage_store_as_w_segname )
LOB_storage_store_as_w_segname
         ::= ( _ ( 'basicfile' | 'securefile' | identifier_name | '(' _ LOB_storage_parameters _ ')' ) _ )+
LOB_storage_store_as_wo_segname
         ::= ( _ ( 'basicfile' | 'securefile' | '(' _ LOB_storage_parameters _ ')' ) _ )+
varray_col_properties
         ::= 'varray' _ identifier_name _ ( substitutable_column_clause | substitutable_column_clause? _ varray_storage_clause )
varray_storage_clause
         ::= 'store' _ 'as' _ ( 'securefile' | 'basicfile' )? _ 'lob' _ ( identifier_name | identifier_name? _ '(' _ LOB_storage_parameters _ ')' )
LOB_storage_parameters
         ::= storage_clause
           | ( _ ( LOB_parameters _ storage_clause? | 'tablespace' _ ( 'set' _ )? identifier_name ) _ )+
LOB_parameters
         ::= ( _ LOB_param )+
LOB_param
         ::= ( 'chunk' | 'pctversion' | 'freepools' ) _ integer
           | ( 'enable' | 'disable' ) _ 'storage' _ 'in' _ 'row'
           | 'encrypt' _ encryption_spec
           | 'decrypt'
           | ( 'cache' ( _ 'reads' )? | 'nocache' ) _ logging_clause?
           | LOB_deduplicate_clause
           | LOB_compression_clause
LOB_deduplicate_clause
         ::= 'deduplicate'
           | 'keep_duplicates'
LOB_retention_clause
         ::= 'retention' _ ( 'max' | 'none' | 'auto' | 'min' _ integer )?
LOB_compression_clause
         ::= 'nocompress'
           | 'compress' _ ( 'low' | 'medium' | 'high' )
JSON_storage_clause
         ::= 'json' _ '(' _ comma_separated_identifiers _ ')' _ 'store' _ 'as' _ identifier_name? _ JSON_parameters?
JSON_parameters
         ::= '(' _ JSON_param _ ( ',' _ JSON_param _ )* ')'
JSON_param
         ::= 'tablespace' _ identifier_name
           | storage_clause
           | 'retention'
           | ( 'chunk' | 'pctversion' | 'freepools' ) _ integer
nested_table_col_properties
         ::= 'nested' _ 'table' _ ( 'COLUMN_VALUE' | identifier_name ) _ substitutable_column_clause? _ ( 'local' | 'global' )? _ 'store' _ 'as' _ identifier_name _ nested_table_col_prop_store_props? _ 'return' _ 'as'? _ ( 'locator' | 'value' )
nested_table_col_prop_store_props
         ::= '(' _ _ ( nested_table_col_prop_store_prop _ _ )+ ')'
nested_table_col_prop_store_prop
         ::= '(' _ object_properties _ ')'
           | physical_properties
           | column_properties
object_properties
         ::= identifier_name _ ( 'default' _ expr )? _ column_constraints?
           | out_of_line_constraint
           | out_of_line_ref_constraint
           | supplemental_logging_props
object_type_col_properties
         ::= 'column' _ identifier_name _ substitutable_column_clause
substitutable_column_clause
         ::= 'not'? _ 'substitutable' _ 'at' _ 'all' _ 'levels'
           | 'element'? _ 'is' _ 'of' _ 'type'? _ '(' _ 'only' _ identifier_name _ ')'
physical_properties
         ::= physical_properties_1
           | physical_properties_2
           | physical_properties_3
physical_properties_1
         ::= deferred_segment_creation? _ segment_attributes_clause _ table_compression? _ inmemory_table_clause? _ ilm_clause? _
physical_properties_2
         ::= deferred_segment_creation? _ ( 'external' _ 'partition' _ 'attributes' _ external_table_clause _ ( 'reject' _ 'limit' )? | 'organization' _ physical_properties_organization )
physical_properties_organization
         ::= 'external' _ external_table_clause
           | 'heap' _ segment_attributes_clause? _ heap_org_table_clause
           | 'index' _ segment_attributes_clause? _ index_org_table_clause
index_org_table_clause
         ::= _ ( index_org_table_option _ _ )* index_org_overflow_clause?
index_org_overflow_clause
         ::= ( 'including' _ identifier_name )? _ 'overflow' _ segment_attributes_clause?
index_org_table_option
         ::= mapping_table_clause
           | prefix_compression
           | 'pctthreshold' _ integer
prefix_compression
         ::= 'compress' _ integer
           | 'nocompress'
mapping_table_clause
         ::= 'mapping' _ 'table'
           | 'nomapping'
heap_org_table_clause
         ::= table_compression? _ inmemory_table_clause? _ ilm_clause? _
external_table_clause
         ::= '(' _ ( 'type' _ identifier_name )? _ external_table_data_props? _ ')' _ ( 'reject' _ 'limit' _ ( 'unlimited' | integer ) )? _ inmemory_table_clause? _
external_table_data_props
         ::= ( 'default' _ 'directory' _ identifier_name )? _ ( 'access' _ 'parameters' _ external_table_data_prop_access_param )? _ ( 'location' _ '(' _ external_table_data_prop_dirs _ ')' )? _
external_table_data_prop_dirs
         ::= external_table_data_prop_dir ( _ ',' _ external_table_data_prop_dir )*
external_table_data_prop_dir
         ::= ( identifier_name _ ':' _ )? _ "'" _ any _ "'"
external_table_data_prop_access_param
         ::= '(' _ ( "'" _ 'opaque_format_spec' _ "'" | 'opaque_format_spec' ) _ ')'
           | 'using' _ 'clob' _ subquery
physical_properties_3
         ::= 'cluster' _ identifier_name _ '(' _ comma_separated_identifiers _ ')'
ilm_clause
         ::= 'ilm' _ ( 'add' _ 'policy' _ ilm_policy_clause | ( 'delete' | 'disable' | 'enable' ) _ 'policy' _ identifier_name | 'delete_all' | 'enable_all' | 'disable_all' )
ilm_policy_clause
         ::= ilm_compression_policy
           | ilm_tiering_policy
           | ilm_inmemory_policy
ilm_inmemory_policy
         ::= ( 'set' _ 'inmemory' _ inmemory_attributes? | 'modify' _ 'inmemory' _ inmemory_memcompress | 'no' _ 'inmemory' ) _ 'segment'? _ ( 'on' _ identifier_name | 'after' _ ilm_time_period _ 'of' _ ( 'no' _ ( 'access' | 'modification' ) | 'creation' ) )
ilm_tiering_policy
         ::= 'tier' _ 'to' _ identifier_name _ ( 'read' _ 'only' _ ( 'segment' | 'group' )? _ ( 'on' _ identifier_name | 'after' _ ilm_time_period _ 'of' _ ( 'no' _ ( 'access' | 'modification' ) | 'creation' ) )? | ( 'segment' | 'group' )? _ ( 'on' _ identifier_name )? )
ilm_compression_policy
         ::= table_compression _ ( 'segment' | 'group' ) _ ( 'on' _ identifier_name | 'after' _ ilm_time_period _ 'of' _ ( 'no' _ ( 'access' | 'modification' ) | 'creation' ) )
           | ( 'row' _ 'store' _ 'compress' _ 'advanced' | 'column' _ 'store' _ 'compress' _ 'for' _ 'query' ) _ 'row' _ 'after' _ ilm_time_period _ 'of' _ 'no' _ 'modification'
ilm_time_period
         ::= integer _ ( 'day' | 'days' | 'month' | 'months' | 'year' | 'years' )
inmemory_table_clause
         ::= ( 'inmemory' _ inmemory_attributes? | 'no' _ 'inmemory' )? _ inmemory_column_clause? _
inmemory_column_clause
         ::= ( _ inmemory_column_def )+
inmemory_column_def
         ::= ( 'inmemory' _ inmemory_memcompress? | 'no' _ 'inmemory' ) _ '(' _ comma_separated_identifiers _ ')'
inmemory_attributes
         ::= inmemory_memcompress? _ inmemory_priority? _ inmemory_distribute? _ inmemory_duplicate? _ inmemory_spatial? _
inmemory_spatial
         ::= 'spatial' _ identifier_name
inmemory_duplicate
         ::= 'duplicate' _ 'all'?
           | 'no' _ 'duplicate'
inmemory_distribute
         ::= 'distribute' _ ( 'auto' | 'by' _ ( 'partition' | 'subpartition' | 'rowid' _ 'range' ) )? _ ( 'for' _ 'service' _ ( 'default' | 'all' | identifier_name | 'none' ) )?
inmemory_priority
         ::= 'priority' _ ( 'none' | 'low' | 'medium' | 'high' | 'critical' )
inmemory_memcompress
         ::= 'no' _ 'memcompress'
           | 'memcompress' _ ( 'auto' | 'for' _ ( 'dml' | ( 'query' | 'capacity' ) _ ( 'low' | 'high' )? )? )
table_compression
         ::= 'compress'
           | 'nocompress'
           | 'row' _ 'store' _ 'compress' _ ( 'basic' | 'advanced' )?
           | 'column' _ 'store' _ 'compress' _ ( 'for' _ ( 'query' | 'archive' ) _ ( 'low' | 'high' )? )? _ ( 'no' _ 'row' _ 'level' _ 'locking' )?
segment_attributes_clause
         ::= ( _ segment_attribute )+
segment_attribute
         ::= 'tablespace' _ ( 'set' _ )? identifier_name
           | logging_clause
           | physical_attributes_clause
physical_attributes_clause
         ::= ( _ physical_attribute _ )+
physical_attribute
         ::= ( 'pctfree' | 'pctused' | 'initrans' ) _ integer
           | storage_clause
storage_clause
         ::= 'storage' _ '(' _ ( storage_option _ )+ _ ')'
storage_option
         ::= ( 'initial' | 'next' ) _ size_clause
           | ( 'pctincrease' | 'minextents' | 'freelist' _ 'groups' | 'freelists' ) _ integer
           | 'maxextents' _ ( integer | 'unlimited' )
           | maxsize_clause
           | 'encrypt'
           | ( 'flash_cache' | 'cell_flash_cache' ) _ ( 'keep' | 'none' | 'default' )
           | 'buffer_pool' _ ( 'keep' | 'recycle' | 'default' )
           | 'optimal' _ ( size_clause | 'null' )?
maxsize_clause
         ::= 'maxsize' _ ( size_clause | 'unlimited' )
size_clause
         ::= integer _ ( 'K' | 'M' | 'G' | 'T' | 'P' | 'E' )?
deferred_segment_creation
         ::= 'segment' _ 'creation' _ ( 'deferred' | 'immediate' )
immutable_table_clauses
         ::= immutable_table_no_drop_clause? _ immutable_table_no_delete_clause?
immutable_table_no_drop_clause
         ::= 'no' _ 'drop' ( _ 'until' _ integer _ 'days' _ 'idle' )?
immutable_table_no_delete_clause
         ::= 'no' _ 'delete' _ ( _ 'until' _ integer _ 'days' _ 'after' _ 'insert' _ )? 'locked'?
blockchain_table_clauses
         ::= blockchain_drop_table_clause _ blockchain_row_retention_clause _ blockchain_hash_and_data_format_clause
blockchain_drop_table_clause
         ::= immutable_table_no_drop_clause
blockchain_row_retention_clause
         ::= immutable_table_no_delete_clause
blockchain_hash_and_data_format_clause
         ::= 'hashing' _ 'using' _ 'sha2_512' _ 'version' _ 'v1'
relational_properties
         ::= relational_property ( _ ',' _ relational_property )*
relational_property
         ::= column_definition
           | out_of_line_property
           | period_definition
           | supplemental_logging_props
supplemental_logging_props
         ::= 'supplemental' _ 'log' _ ( supplemental_log_grp_clause | supplemental_id_key_clause )
supplemental_id_key_clause
         ::= 'data' _ '(' _ supplemental_id_key_column _ ( ',' _ supplemental_id_key_column _ )* ')' _ 'columns'
supplemental_id_key_column
         ::= 'unique'
           | 'all'
           | ( 'primary' | 'foreign' ) _ 'key'
supplemental_log_grp_clause
         ::= 'group' _ identifier_name _ '(' _ supplemental_log_grp_column _ ( ',' _ supplemental_log_grp_column _ )* ')' _ 'always'?
supplemental_log_grp_column
         ::= identifier_name _ ( 'no' _ 'log' )?
period_definition
         ::= 'period' _ 'for' _ identifier_name _ ( '(' _ identifier_name _ ',' _ identifier_name _ ')' )?
out_of_line_property
         ::= out_of_line_constraint
           | out_of_line_ref_constraint
out_of_line_ref_constraint
         ::= 'scope' _ 'for' _ '(' _ identifier_name _ ')' _ 'is' _ identifier_name ( _ '.' _ identifier_name )?
           | 'ref' _ '(' _ identifier_name _ ')' _ 'with' _ 'rowid'
           | ( 'constraint' _ identifier_name )? _ 'foreign' _ 'key' _ '(' _ comma_separated_identifiers _ ')' _ references_clause _ constraint_state?
out_of_line_constraint
         ::= ( 'constraint' _ identifier_name )? _ ( ( ( 'unique' | 'primary' _ 'key' ) _ '(' _ comma_separated_identifiers | 'check' _ '(' _ condition ) _ ')' | 'foreign' _ 'key' _ '(' _ comma_separated_identifiers _ ')' _ references_clause ) _ constraint_state?
column_definition
         ::= identifier_name _ data_type _ ( 'collate' _ identifier_name )? _ 'sort'? _ ( 'visible' | 'invisible' )? _ ( column_default_clause | identity_clause )? _ ( 'encrypt' _ encryption_spec? )? _ column_constraints? _
column_constraints
         ::= inline_ref_constraint
           | inline_constraints
inline_ref_constraint
         ::= 'scope' _ 'is' _ identifier_name ( _ '.' _ identifier_name )?
           | 'with' _ 'rowid'
           | ( 'constraint' _ identifier_name )? _ references_clause _ constraint_state?
inline_constraints
         ::= ( _ inline_constraint )*
inline_constraint
         ::= ( 'constraint' _ identifier_name )? _ ( 'not'? _ 'null' | 'unique' | 'primary' _ 'key' | 'check' _ '(' _ condition _ ')' | references_clause ) _ constraint_state?
constraint_state
         ::= ( deferrable_clause _ initially_clause? | initially_clause _ deferrable_clause? ) _ ( 'rely' | 'norely' )? _ using_index_clause? _ ( 'enable' | 'disable' )? _ ( 'validate' | 'novalidate' )? _ exception_clause?
exception_clause
         ::= 'exceptions' _ 'into' _ identifier_name ( _ '.' _ identifier_name )?
using_index_clause
         ::=
deferrable_clause
         ::= 'not'? _ 'deferrable'
initially_clause
         ::= 'initially' _ ( 'deferred' | 'immediate' )
references_clause
         ::= 'references' _ ( identifier_name _ '.' _ )? _ identifier_name _ ( '(' _ comma_separated_identifiers _ ')' )? _ ( 'on' _ 'delete' _ ( 'cascade' | 'set' _ 'null' ) )?
encryption_spec
         ::= ( 'using' _ single_quoted_str )? _ ( 'identified' _ 'by' _ ident_name )? _ single_quoted_str? _ ( 'no'? _ 'salt' )?
column_default_clause
         ::= 'default' _ ( 'on' _ 'null' )? _ expr
identity_clause
         ::= 'generated' _ ( 'always' | 'by' _ 'default' ( 'on' _ 'null' )? )? _ 'as' _ 'identity' _ identity_options?
identity_options
         ::= '(' _ ( order_clause | cycle_clause | cache_clause | minvalue_clause | maxvalue_clause | increment_clause | start_clause )+ _ ')'
order_clause
         ::= 'order'
           | 'noorder'
cycle_clause
         ::= 'cycle'
           | 'nocycle'
cache_clause
         ::= 'cache' _ integer
           | 'nocache'
minvalue_clause
         ::= 'minvalue' _ integer
           | 'nominvalue'
maxvalue_clause
         ::= 'maxvalue' _ integer
           | 'nomaxvalue'
increment_clause
         ::= 'increment' _ 'by' _ integer
keep_clause
         ::= 'keep'
           | 'nokeep'
start_clause
         ::= 'start' _ 'with' _ ( integer | 'limit' _ 'value' )
data_type
         ::= ansi_supported_data_type
           | oracle_supplied_type
           | oracle_built_in_data_type
oracle_built_in_data_type
         ::= character_data_type
           | number_data_type
           | rowid_data_type
           | long_and_raw_data_type
           | datetime_data_type
           | large_object_data_type
           | boolean_type
boolean_type
         ::= 'bool'
           | 'boolean'
character_data_type
         ::= character_data_type_with_size
           | character_data_type_with_size_and_semantics
character_data_type_with_size
         ::= character_data_type_name _ ( '(' _ integer _ ')' )?
character_data_type_with_size_and_semantics
         ::= character_data_type_name_with_semantics _ character_data_type_size_and_semantics?
character_data_type_size_and_semantics
         ::= '(' _ integer _ ( 'byte' | 'char' )? _ ')'
character_data_type_name
         ::= 'nchar'
           | 'nvarchar2'
character_data_type_name_with_semantics
         ::= 'char'
           | 'varchar2'
number_data_type
         ::= 'binary_float'
           | 'binary_double'
           | 'float' _ ( '(' _ integer _ ')' )?
           | 'number' _ ( '(' _ integer _ ( ',' _ integer )? _ ')' )?
long_and_raw_data_type
         ::= 'long raw'
           | 'long'
           | 'raw' _ '(' _ integer _ ')'
large_object_data_type
         ::= 'blob'
           | 'clob'
           | 'nclob'
           | 'bfile'
rowid_data_type
         ::= 'rowid'
           | 'urowid' _ ( '(' _ integer _ ')' )?
datetime_data_type
         ::= 'date'
           | datetime_type_timestamp
           | datetime_type_interval_day
           | datetime_type_interval_year
datetime_type_timestamp
         ::= 'timestamp' _ ( '(' _ integer _ ')' )? _ ( 'with' _ 'local'? _ 'time' _ 'zone' )?
datetime_type_interval_year
         ::= 'interval' _ 'year' _ ( '(' _ integer _ ')' )? _ 'to' _ 'month'
datetime_type_interval_day
         ::= 'interval' _ 'day' _ ( '(' _ integer _ ')' )? _ 'to' _ 'second' _ ( '(' _ integer _ ')' )?
oracle_supplied_type
         ::= any_type
           | XML_type
           | spacial_type
spacial_type
         ::= 'SDO_Geometry'
           | 'SDO_Topo_Geometry'
           | 'SDO_GeoRaster'
XML_type ::= 'XMLType'
           | 'URIType'
any_type ::= 'sys.anydataset'
           | 'sys.anydata'
           | 'sys.anytype'
ansi_supported_data_type
         ::= ( ( 'character' | 'national' _ ( 'char' | 'character' ) ) _ 'varying'? | ( 'char' | 'nchar' ) _ 'varying' | 'varchar' ) _ '(' _ integer _ ')'
           | 'int'
           | 'integer'
           | 'smallint'
           | 'real'
           | 'float' _ ( '(' _ integer _ ')' )?
           | ( 'numeric' | 'decimal' | 'dec' ) ( '(' _ integer _ ( ',' _ integer )? _ ')' )?
           | 'double' _ 'precision'
logging_clause
         ::= 'logging'
           | 'nologging'
           | 'filesystem_like_logging'
object_table
         ::=
XMLType_table
         ::=
drop_table_stmt
         ::= 'drop' _ 'table' _ schema_object _ ( 'cascade' _ 'constraints' )? _ 'purge'? _ ';'
alter_table_stmt
         ::= 'alter' _ 'table' _ schema_object _ memoptimize_read_clause? _ memoptimize_write_clause? _ alter_table_stmt_body? alter_table_stmt_settings? _ ';'
alter_table_stmt_settings
         ::= ( _ alter_table_stmt_setting _ )+
alter_table_stmt_setting
         ::= enable_disable_clause
           | ( 'enable' | 'disable' ) _ ( 'table' _ 'lock' | 'all' _ 'triggers' | 'container_map' | 'containers_default' )
alter_table_stmt_body
         ::= alter_table_properties
           | column_clauses
           | constraint_clauses
           | modify_opaque_type
           | immutable_table_clauses
           | blockchain_table_clauses
modify_opaque_type
         ::= 'modify' _ 'opaque' _ 'type' _ identifier_name _ 'store' _ '(' _ comma_separated_identifiers _ ')' _ 'unpacked'
column_clauses
         ::= rename_column_clause
           | ( _ column_clauses_action_option _ )+
column_clauses_action_option
         ::= add_column_clause
add_column_clause
         ::= 'add' _ ( column | '(' _ column _ ( ',' _ column _ )* ')' ) _ column_properties? _
column   ::= column_definition
           | virtua_column_definition
virtua_column_definition
         ::= identifier_name _ data_type _ ( 'collate' _ identifier_name )? _ ( 'visible' | 'invisible' )? _ ( 'generated' _ 'always' )? _ 'as' _ '(' _ expr _ ')' _ 'virtual'? _ evaluation_edition_clause? _ unusable_editions_cluase? _ _ ( inline_constraint _ _ )*
unusable_editions_cluase
         ::= unusable_editions_clause_before? _ unusable_editions_clause_beginning?
unusable_editions_clause_before
         ::= 'unusable' _ 'before' _ ( 'current' _ 'edition' | 'edition' _ identifier_name )
unusable_editions_clause_beginning
         ::= 'unusable' _ 'beginning' _ 'with' _ ( ( 'current' | 'null' ) _ 'edition' | 'edition' _ identifier_name )
evaluation_edition_clause
         ::= 'evaluate' _ 'using' ( ( 'current' | 'null' ) _ 'edition' | 'edition' _ identifier_name )
rename_column_clause
         ::= 'rename' _ 'column' _ identifier_name _ 'to' _ identifier_name
alter_table_properties
         ::= 'read' _ 'only'
           | 'rekey' _ encryption_spec
           | default_collation_clause
           | 'no'? _ 'row' _ 'archival'
           | 'drop' _ 'clustering'
           | 'modify' _ 'clustering' _ clustering_when? _ zonemap_clause?
           | 'add' _ attribute_clusering_clause
           | shrink_clause
           | ( alter_table_properties_options | 'rename' _ 'to' _ identifier_name ) _ alter_iot_clauses? _ alter_XMLSchema_clause?
alter_table_properties_options
         ::= physical_attributes_clause
           | logging_clause
           | table_compression
           | inmemory_table_clause
           | ilm_clause
           | supplemental_table_logging
           | allocate_extent_clause
           | deallocate_unused_clause
           | 'cache'
           | 'nocache'
           | result_cache_clause
           | upgrade_table_clause
           | records_per_block_clause
           | parallel_clause
           | row_movement_clause
           | logical_replication_clause
           | flashback_archive_clause
records_per_block_clause
         ::= ( 'minimize' | 'nominimize' ) _ 'records_per_block'
upgrade_table_clause
         ::= 'upgrade' _ 'not'? _ 'including' _ 'data' _ column_properties
supplemental_table_logging
         ::= 'add' _ supplemental_logging_props
           | 'drop' _ ( supplemental_id_key_clause | 'group' _ identifier_name )
alter_XMLSchema_clause
         ::= 'allow' _ ( 'anyschema' | 'nonschema' )
           | 'disallow' _ 'nonschema'
alter_iot_clauses
         ::= 'coalesce'
           | alter_overflow_clause
           | alter_mapping_table_clauses
           | index_org_table_clause
alter_mapping_table_clauses
         ::= 'mapping' _ 'table' _ ( allocate_extent_clause | deallocate_unused_clause )
alter_overflow_clause
         ::= add_overflow_clause
           | 'overflow' _ ( _ ( segment_attributes_clause | shrink_clause | deallocate_unused_clause | allocate_extent_clause ) )+
allocate_extent_clause
         ::= 'allocate' _ 'extent' _ ( '(' _ _ ( ( 'size' _ size_clause | 'instance' _ integer | 'datafile' _ single_quoted_str ) _ _ )+ ')' )?
deallocate_unused_clause
         ::= 'deallocate' _ 'unused' _ ( 'keep' _ size_clause )?
add_overflow_clause
         ::= 'add' _ 'overflow' _ segment_attributes_clause? _ add_overflow_clause_partitions?
add_overflow_clause_partitions
         ::= '(' _ add_overflow_clause_partition _ ( ',' _ add_overflow_clause_partition _ )* ')'
add_overflow_clause_partition
         ::= 'partition' _ segment_attributes_clause?
shrink_clause
         ::= 'shrink' _ 'space' _ 'compact' _ 'cascade'
constraint_clauses
         ::= add_constraint_clauses
           | rename_constraint_clauses
           | drop_constraint_clause
           | modify_constraint_clause
modify_constraint_clause
         ::= 'modify' _ ( 'primary' _ 'key' | 'constraint' _ identifier_name | 'unique' _ '(' _ comma_separated_identifiers _ ')' ) _ constraint_state 'cascade'?
drop_constraint_clause
         ::= 'drop' _ ( 'primary' _ 'key' | 'constraint' _ identifier_name | 'unique' _ '(' _ comma_separated_identifiers _ ')' ) _ 'cascade'? _ ( ( 'keep' | 'drop' ) _ 'index' )? _ 'online'?
rename_constraint_clauses
         ::= 'rename' _ 'constraint' _ identifier_name _ 'to' _ identifier_name
add_constraint_clauses
         ::= 'add' _ ( out_of_line_ref_constraint | ( _ out_of_line_constraint _ )+ )
memoptimize_read_clause
         ::= ( 'no' _ )? 'memoptimize' _ 'for' _ 'read'
memoptimize_write_clause
         ::= ( 'no' _ )? 'memoptimize' _ 'for' _ 'write'
default_collation_clause
         ::= 'default' _ 'collation' _ identifier_name
literal  ::= string
           | number
           | integer
           | date
date     ::= date_option _ single_quoted_str
date_option
         ::= 'date'
           | 'timestamp' ( _ 'with' _ ( 'local' _ )? 'time' _ 'zone' )?
sign     ::= '+'
           | '-'
subquery ::=
expr     ::= integer
condition
         ::=
comma_separated_identifiers
         ::= identifier_name ( _ ',' _ identifier_name )*
single_quoted_str
         ::= "'" any "'"
identifier_name
         ::= ident_name
ident_name
         ::= ident_start ident_part*

<?TOKENS?>

number   ::= sign? ( '.' [0-9] | [0-9]+ '.' ) [0-9]* ( 'E' sign? [0-9]+ )? ( 'F' | 'D' )?
integer  ::= sign? [0-9]+
string   ::= 'N'? ( "'" [^']* | 'Q' "'" special_quoted_literal ) "'"
special_quoted_literal
         ::= quote_delimiter [^']*
quote_delimiter
         ::= [^s#x9#xD]
any      ::= [^']+
ident_start
         ::= [a-zA-Z_]
ident_part
         ::= [a-zA-Z0-9_]
_        ::= [ #x9#xA#xD]*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions