Supported SQL Syntax¶
The EBNF and Railroad Diagrams for the supported SQL Syntax. Kindly provided by Gunther Rademacher.
Statement¶
::= 'IF' Condition ( SingleStatement | Block ) ST_SEMICOLON? ( 'ELSE' ( SingleStatement | Block ) ST_SEMICOLON? )?
SingleStatement¶
::= WithList? ( SelectWithWithItems | InsertWithWithItems | UpdateWithWithItems | DeleteWithWithItems | Merge )
| Select
| Upsert
| Alter
| Create
| Drop
| Analyze
| Truncate
| Execute
| Set
| Reset
| Show
| Use
| 'COMMIT'
| Comment
| Describe
| Explain
| Declare
| Grant
Block¶
Statements¶
::= ( ST_SEMICOLON* ( 'IF' Condition ( SingleStatement | Block ) ST_SEMICOLON? ( 'ELSE' ( SingleStatement | Block ) ST_SEMICOLON? )? | ( SingleStatement | Block ) ( ST_SEMICOLON | EOF ) ) ( ST_SEMICOLON* ( 'IF' Condition ( ( SingleStatement | Block ) ST_SEMICOLON? 'ELSE' )? )? ( SingleStatement | Block ) ST_SEMICOLON* )* UnsupportedStatement? )* EOF
Declare¶
Declare ::= 'DECLARE' UserVariable ( 'TABLE' '(' ColumnDefinition ( ',' ColumnDefinition )* ')' | 'AS' RelObjectName | ColDataType ( '=' Expression )? ( ',' UserVariable ColDataType ( '=' Expression )? )* )
Set¶
Set ::= 'SET' ( 'LOCAL' | 'SESSION' )? ( K_DATETIMELITERAL 'ZONE' | ( UserVariable | IdentifierChain ) '='? ) Expression ( ',' ( K_DATETIMELITERAL 'ZONE' | RelObjectNameExt '='? )? Expression )*
Reset¶
RenameTableStatement¶
PurgeStatement¶
::= 'PURGE' ( 'TABLE' Table | 'INDEX' Index | 'RECYCLEBIN' | 'DBA_RECYCLEBIN' | 'TABLESPACE' S_IDENTIFIER ( 'USER' S_IDENTIFIER )? )
Describe¶
Explain¶
ExplainOptionBoolean¶
::= ( 'TRUE' | 'FALSE' | 'ON' | 'OFF' )?
ExplainFormatOption¶
::= ( 'XML' | 'JSON' | 'YAML' )?
ExplainStatementOptions¶
::= ( ( 'ANALYZE' | 'BUFFERS' | 'COSTS' | 'VERBOSE' ) ExplainOptionBoolean | ( 'FORMAT' | 'PLAN' 'FOR'? ) ExplainFormatOption )*
Use¶
Use ::= 'USE' 'SCHEMA'? RelObjectNameExt
Show¶
ShowColumns¶
::= 'COLUMNS' 'FROM' RelObjectNameExt
ShowIndex¶
::= 'INDEX' 'FROM' RelObjectNameExt
RefreshMaterializedView¶
::= 'REFRESH' 'MATERIALIZED' 'VIEW' 'CONCURRENTLY'? Table ( 'WITH' 'NO'? 'DATA' )? captureRest
ShowTables¶
::= 'EXTENDED'? 'FULL'? 'TABLES' ( ( 'FROM' | 'IN' ) RelObjectNameExt )? ( 'LIKE' SimpleExpression | 'WHERE' Expression )?
Values¶
Values ::= ( 'VALUES' | 'VALUE' ) ExpressionList
ReturningClause¶
::= ( 'RETURNING' | 'RETURN' ) SelectItemsList ( 'INTO' ( Table | UserVariable ) ( ',' ( Table | UserVariable ) )* )?
UpdateWithWithItems¶
::= Update
Update¶
Update ::= 'UPDATE' 'LOW_PRIORITY'? 'IGNORE'? TableWithAliasAndMysqlIndexHint JoinsList? 'SET' UpdateSets OutputClause? ( 'FROM' FromItem JoinsList? )? WhereClause? OrderByElements? PlainLimit? ReturningClause?
UpdateSets¶
::= ( Column '=' Expression | ParenthesedExpressionList '=' ( ParenthesedSelect | ParenthesedExpressionList ) ) ( ',' Column '=' Expression | ParenthesedExpressionList '=' ( ParenthesedSelect | ParenthesedExpressionList ) )*
InsertWithWithItems¶
::= Insert
Insert¶
Insert ::= 'INSERT' ( 'LOW_PRIORITY' | 'DELAYED' | 'HIGH_PRIORITY' )? 'IGNORE'? 'INTO'?
Table ( 'AS'? RelObjectNameWithoutValue )? ( '(' ColumnList ')' )? OutputClause? ( 'DEFAULT' 'VALUES' | 'SET' UpdateSets | Select ) ( 'ON' 'DUPLICATE' 'KEY' 'UPDATE' UpdateSets )? ( 'ON' 'CONFLICT' InsertConflictTarget? InsertConflictAction )? ReturningClause?
InsertConflictTarget¶
| 'ON' 'CONSTRAINT' RelObjectNameExt2
InsertConflictAction¶
::= 'DO' ( 'NOTHING' | 'UPDATE' 'SET' UpdateSets WhereClause? )
OutputClause¶
Upsert¶
Upsert ::= ( 'UPSERT' | ( 'INSERT' 'OR' )? 'REPLACE' ) 'INTO'? Table ParenthesedColumnList? ( 'SET' UpdateSets | Select ) ( 'ON' 'DUPLICATE' 'KEY' 'UPDATE' UpdateSets )?
DeleteWithWithItems¶
::= Delete
Delete¶
Delete ::= 'DELETE' 'LOW_PRIORITY'? 'QUICK'? 'IGNORE'? ( ( TableWithAlias ( ',' TableWithAlias )* OutputClause? )? 'FROM' )? ( TableWithAlias JoinsList? )? ( 'USING' TableWithAlias ( ',' TableWithAlias )* )? WhereClause? OrderByElements? PlainLimit? ReturningClause?
Merge¶
Merge ::= 'MERGE' 'INTO' TableWithAlias 'USING' FromItem 'ON' Expression MergeOperations OutputClause?
MergeOperations¶
::= ( MergeWhenMatched | MergeWhenNotMatched )*
MergeWhenMatched¶
::= 'WHEN' 'MATCHED' ( 'AND' Expression )? 'THEN' ( 'DELETE' | MergeUpdateClause )
MergeUpdateClause¶
MergeWhenNotMatched¶
::= 'WHEN' 'NOT' 'MATCHED' ( 'AND' Expression )? 'THEN' 'INSERT' ( '(' ColumnList ')' )? 'VALUES' '(' SimpleExpressionList ')' ( 'WHERE' Expression )?
RelObjectNames¶
::= RelObjectNameExt ( ( '.' | ':' )+ RelObjectNameExt2 )*
Column¶
RelObjectNameWithoutValue¶
::= DATA_TYPE
| 'ACTION'
| 'ACTIVE'
| 'ADD'
| 'ADVANCE'
| 'ADVISE'
| 'AGAINST'
| 'ALGORITHM'
| 'ALTER'
| 'ANALYZE'
| 'APPLY'
| 'APPROXIMATE'
| 'ARCHIVE'
| 'ARRAY'
| 'ASC'
| 'AT'
| 'AUTHORIZATION'
| 'AUTO'
| 'BASE64'
| 'BEGIN'
| 'BERNOULLI'
| 'BINARY'
| 'BIT'
| 'BLOCK'
| 'BROWSE'
| 'BUFFERS'
| 'BY'
| 'BYTE'
| 'BYTES'
| 'CACHE'
| 'CALL'
| 'CASCADE'
| 'CASE'
| 'CAST'
| 'CHANGE'
| 'CHANGES'
| 'CHAR'
| 'CHARACTER'
| 'CHECKPOINT'
| 'CLOSE'
| 'COLLATE'
| 'COLUMN'
| 'COLUMNS'
| 'COMMENT'
| 'COMMIT'
| 'CONCURRENTLY'
| 'CONFLICT'
| 'CONSTRAINTS'
| 'CONVERT'
| 'COSTS'
| 'CS'
| 'CYCLE'
| 'DATA'
| 'DATABASE'
| 'DATETIME'
| 'DBA_RECYCLEBIN'
| 'DDL'
| 'DECLARE'
| 'DEFERRABLE'
| 'DELAYED'
| 'DELETE'
| 'DESC'
| 'DESCRIBE'
| 'DISABLE'
| 'DISCONNECT'
| 'DIV'
| 'DML'
| 'DO'
| 'DOMAIN'
| 'DROP'
| 'DUMP'
| 'DUPLICATE'
| 'ELEMENTS'
| 'EMIT'
| 'ENABLE'
| 'END'
| 'ESCAPE'
| 'EXCLUDE'
| 'EXEC'
| 'EXECUTE'
| 'EXPLAIN'
| 'EXPLICIT'
| 'EXTENDED'
| 'EXTRACT'
| 'FALSE'
| 'FILTER'
| 'FIRST'
| 'FLUSH'
| 'FN'
| 'FOLLOWING'
| 'FORMAT'
| 'FULLTEXT'
| 'FUNCTION'
| 'GRANT'
| 'GROUP_CONCAT'
| 'GUARD'
| 'HASH'
| 'HIGH_PRIORITY'
| 'HISTORY'
| 'HOPPING'
| 'INCLUDE'
| 'INCLUDE_NULL_VALUES'
| 'INCREMENT'
| 'INDEX'
| 'INSERT'
| 'INTERLEAVE'
| 'INTERPRET'
| 'INVALIDATE'
| 'ISNULL'
| 'JSON'
| 'JSON_ARRAY'
| 'JSON_ARRAYAGG'
| 'JSON_OBJECT'
| 'JSON_OBJECTAGG'
| 'KEEP'
| 'KEY'
| 'KEYS'
| 'LAST'
| 'LEADING'
| 'LINK'
| 'LOCAL'
| 'LOCKED'
| 'LOG'
| 'LONGTEXT'
| 'LOOP'
| 'LOW_PRIORITY'
| 'MATCH'
| 'MATCHED'
| 'MATERIALIZED'
| 'MAX'
| 'MAXVALUE'
| 'MEDIUMTEXT'
| 'MEMBER'
| 'MERGE'
| 'MIN'
| 'MINVALUE'
| 'MODIFY'
| 'MOVEMENT'
| 'NEXT'
| 'NO'
| 'NOCACHE'
| 'NOKEEP'
| 'NOLOCK'
| 'NOMAXVALUE'
| 'NOMINVALUE'
| 'NOORDER'
| 'NOTHING'
| 'NOTNULL'
| 'NOVALIDATE'
| 'NOWAIT'
| 'NULLS'
| 'OF'
| 'OFF'
| 'OPEN'
| 'OVER'
| 'OVERLAPS'
| 'PARALLEL'
| 'PARENT'
| 'PARTITION'
| 'PATH'
| 'PERCENT'
| 'PLACING'
| 'PLAN'
| 'PRECEDING'
| 'PRIMARY'
| 'PRIOR'
| 'PURGE'
| 'QUERY'
| 'QUICK'
| 'QUIESCE'
| 'RANGE'
| 'RAW'
| 'READ'
| 'RECURSIVE'
| 'RECYCLEBIN'
| 'REFERENCES'
| 'REFRESH'
| 'REGEXP'
| 'REGEXP_LIKE'
| 'REGISTER'
| 'REMOTE'
| 'RENAME'
| 'REPEATABLE'
| 'REPLACE'
| 'RESET'
| 'RESPECT'
| 'RESTART'
| 'RESTRICT'
| 'RESTRICTED'
| 'RESUMABLE'
| 'RESUME'
| 'RETURN'
| 'RLIKE'
| 'ROLLBACK'
| 'ROLLUP'
| 'ROOT'
| 'ROW'
| 'ROWS'
| 'RR'
| 'RS'
| 'SAFE_CAST'
| 'SAVEPOINT'
| 'SCHEMA'
| 'SECURE'
| 'SEED'
| 'SEPARATOR'
| 'SEQUENCE'
| 'SESSION'
| 'SETS'
| 'SHARE'
| 'SHOW'
| 'SHUTDOWN'
| 'SIBLINGS'
| 'SIGNED'
| 'SIMILAR'
| 'SIZE'
| 'SKIP'
| 'STORED'
| 'STRING'
| 'STRUCT'
| 'SUMMARIZE'
| 'SUSPEND'
| 'SWITCH'
| 'SYNONYM'
| 'SYSTEM'
| 'TABLE'
| 'TABLESPACE'
| 'TEMP'
| 'TEMPORARY'
| 'TEXT'
| 'THEN'
| 'TIMEOUT'
| 'TIMESTAMPTZ'
| 'TIMEZONE'
| 'TINYTEXT'
| 'TO'
| 'TRIGGER'
| 'TRUE'
| 'TRUNCATE'
| 'TRY_CAST'
| 'TUMBLING'
| 'TYPE'
| 'UNLOGGED'
| 'UNQIESCE'
| 'UNSIGNED'
| 'UPDATE'
| 'UPSERT'
| 'UR'
| 'USER'
| 'VALIDATE'
| 'VERBOSE'
| 'VIEW'
| 'VOLATILE'
| 'WAIT'
| 'WITHIN'
| 'WITHOUT'
| 'WITHOUT_ARRAY_WRAPPER'
| 'WORK'
| 'XML'
| 'XMLAGG'
| 'XMLDATA'
| 'XMLSCHEMA'
| 'XMLTEXT'
| 'XSINIL'
| 'YAML'
| 'YES'
| 'ZONE'
RelObjectName¶
| 'GROUP'
| 'INTERVAL'
| 'ON'
| 'START'
| 'TOP'
| 'VALUE'
| 'VALUES'
| 'CREATE'
| 'TABLES'
| 'CONNECT'
| 'IGNORE'
| 'QUALIFY'
| 'DEFAULT'
RelObjectNameWithoutStart¶
| 'TOP'
| 'VALUE'
| 'VALUES'
| 'INTERVAL'
RelObjectNameExt¶
::= RelObjectName
| 'ALL'
| 'ANY'
| 'SOME'
| 'LEFT'
| 'RIGHT'
| 'SET'
| 'IF'
| 'IIF'
| 'OPTIMIZE'
| 'LIMIT'
| 'OFFSET'
| 'PROCEDURE'
| 'PUBLIC'
| 'CASEWHEN'
| 'IN'
| 'GROUPING'
| 'ORDER'
| 'GLOBAL'
RelObjectNameExt2¶
::= RelObjectNameExt
| 'FROM'
| K_SELECT
| 'CURRENT'
Table¶
Table ::= RelObjectNames
TableWithAlias¶
TableWithAliasAndMysqlIndexHint¶
Number¶
| S_LONG
SampleClause¶
SelectWithWithItems¶
::= Select
Select¶
TableStatement¶
ParenthesedSelect¶
::= '(' Select ')'
ParenthesedInsert¶
::= '(' Insert ')'
ParenthesedUpdate¶
::= '(' Update ')'
ParenthesedDelete¶
::= '(' Delete ')'
LateralView¶
ForClause¶
::= 'FOR' ( 'BROWSE' | 'XML' ( ( 'RAW' ( '(' S_CHAR_LITERAL ')' )? | 'AUTO' ) ( ',' ( 'BINARY' 'BASE64' | 'TYPE' | ( 'ROOT' | 'XMLSCHEMA' ) (
'(' S_CHAR_LITERAL ')' )? | 'XMLDATA' | 'ELEMENTS' ( 'XSINIL' | 'ABSENT' )? ) )* | 'EXPLICIT' ( ','
( 'BINARY' 'BASE64' | 'TYPE' | 'ROOT' ( '(' S_CHAR_LITERAL ')' )? | 'XMLDATA' ) )* | 'PATH' ( '(' S_CHAR_LITERAL ')' )? ( ',' ( 'BINARY' 'BASE64' | 'TYPE' | 'ROOT' ( '(' S_CHAR_LITERAL ')' )? | 'ELEMENTS' ( 'XSINIL' | 'ABSENT' )? ) )* ) | 'JSON' ( 'AUTO' | 'PATH' )
( ',' ( 'ROOT' ( '(' S_CHAR_LITERAL ')' )? | 'INCLUDE_NULL_VALUES' | 'WITHOUT_ARRAY_WRAPPER' ) )* )
LateralViews¶
::= LateralView+
LateralSubSelect¶
::= 'LATERAL' '(' Select ')'
PlainSelect¶
::= K_SELECT 'STRAIGHT_JOIN'? Skip? First? Top? ( 'ALL' | 'DISTINCT' ( 'ON' '(' SelectItemsList ')' )? | 'UNIQUE' | 'SQL_CALC_FOUND_ROWS' | 'SQL_NO_CACHE' | 'SQL_CACHE' )? ( 'AS'
( 'STRUCT' | 'VALUE' ) )? Top? SelectItemsList IntoClause? ( 'FROM' FromItem LateralViews? JoinsList? )? ( 'FROM' 'ONLY' FromItem LateralViews? JoinsList? )? 'FINAL'? KSQLWindowClause? WhereClause? OracleHierarchicalQueryClause? Having? GroupByColumnReferences? Having? Qualify? ForClause? OrderByElements? ( 'WINDOW' RelObjectName 'AS' windowDefinition ( ',' RelObjectName 'AS' windowDefinition )* )? OrderByElements? ( 'EMIT' 'CHANGES' )? LimitBy? LimitWithOffset? Offset? LimitWithOffset? Fetch? WithIsolation? ( 'FOR' ( ( 'NO' 'KEY' )? 'UPDATE' | 'KEY'? 'SHARE' ) ( 'OF' Table )? Wait? ( 'NOWAIT' | 'SKIP' 'LOCKED' )? )? OptimizeFor? ( 'INTO' 'TEMP' Table )? ( 'WITH' 'NO' 'LOG' )?
SetOperationList¶
::= ( ( 'UNION' ( 'ALL' | 'DISTINCT' )? | 'INTERSECT' | 'MINUS' | 'EXCEPT'
) ( PlainSelect | Values | ParenthesedSelect ) )+ OrderByElements? LimitWithOffset? Offset? LimitWithOffset? Fetch? WithIsolation?
WithList¶
WithItem¶
WithItem ::= 'RECURSIVE'? RelObjectName ( '(' SelectItemsList ')' )? 'AS' ( ParenthesedSelect | ParenthesedInsert | ParenthesedUpdate | ParenthesedDelete )
ColumnSelectItemsList¶
::= SelectItem ( ',' SelectItem )*
SelectItemsList¶
::= SelectItem ( ',' SelectItem )*
SelectItem¶
AllColumns¶
::= '*' ( ( 'EXCEPT' | 'EXCLUDE' ) ParenthesedColumnList )? ( 'REPLACE' '(' ColumnSelectItemsList ')' )?
AllTableColumns¶
::= Table '.' AllColumns
Alias¶
Alias ::= 'AS' RelObjectNameWithoutStart? '(' RelObjectName ColDataType? ( ',' RelObjectName ColDataType? )* ')'
| 'AS'? ( RelObjectNameWithoutStart | S_CHAR_LITERAL ) ( '(' RelObjectName ColDataType? ( ',' RelObjectName ColDataType? )* ')' )?
SQLServerHint¶
::= 'INDEX' '(' RelObjectName ')'
| 'NOLOCK'
SQLServerHints¶
::= 'WITH' '(' SQLServerHint ( ',' SQLServerHint )* ')'
MySQLIndexHint¶
::= ( 'USE' | 'SHOW' | 'IGNORE' | 'FORCE' ) ( 'INDEX' | 'KEY' ) '(' RelObjectNameWithoutValue ( ',' RelObjectNameWithoutValue )* ')'
FunctionItem¶
PivotForColumns¶
| Column
PivotFunctionItems¶
::= FunctionItem ( ',' FunctionItem )*
ExpressionListItem¶
PivotMultiInItems¶
::= ExpressionListItem ( ',' ExpressionListItem )*
Pivot¶
Pivot ::= 'PIVOT' '(' PivotFunctionItems 'FOR' PivotForColumns 'IN' '(' ( SelectItemsList | PivotMultiInItems ) ')' ')' Alias?
PivotXml¶
PivotXml ::= 'PIVOT' 'XML' '(' PivotFunctionItems 'FOR' PivotForColumns 'IN' '(' ( 'ANY' | Select | SelectItemsList | PivotMultiInItems ) ')' ')'
UnPivot¶
UnPivot ::= 'UNPIVOT' ( ( 'INCLUDE' | 'EXCLUDE' ) 'NULLS' )? '(' PivotForColumns 'FOR' PivotForColumns 'IN' '(' SelectItemsList ')' ')' Alias?
IntoClause¶
ParenthesedFromItem¶
FromItem¶
FromItem ::= ( Values | TableFunction | Table | ParenthesedFromItem | ParenthesedSelect Pivot? UnPivot? | LateralSubSelect ) Alias? SampleClause? UnPivot? ( PivotXml | Pivot )? ( MySQLIndexHint | SQLServerHints )?
JoinsList¶
::= JoinerExpression+
JoinHint¶
JoinHint ::= 'LOOP'
| 'HASH'
| 'MERGE'
| 'REMOTE'
JoinerExpression¶
::= 'GLOBAL'? 'NATURAL'? ( ( 'RIGHT' | 'FULL' )? 'OUTER'? | 'LEFT' ( 'SEMI'
| 'OUTER' )? | 'INNER' | 'CROSS' ) ( JoinHint? 'JOIN' | ',' 'OUTER'? | 'STRAIGHT_JOIN' | 'APPLY' ) FromItem ( ( 'WITHIN' '(' JoinWindow ')' )? ( 'ON' Expression )+ | 'USING' '(' Column ( ',' Column )* ')' )?
JoinWindow¶
KSQLWindowClause¶
::= 'WINDOW' ( 'HOPPING' '(' 'SIZE' S_LONG S_IDENTIFIER ',' 'ADVANCE' 'BY' | 'SESSION' '(' | 'TUMBLING' '(' 'SIZE' ) S_LONG S_IDENTIFIER ')'
WhereClause¶
::= 'WHERE' Expression
OracleHierarchicalQueryClause¶
::= ( 'START' 'WITH' AndExpression 'CONNECT' 'BY' 'NOCYCLE'? | 'CONNECT' 'BY' 'NOCYCLE'? ( AndExpression 'START' 'WITH' )? ) AndExpression
GroupByColumnReferences¶
::= 'GROUP' 'BY' ( 'GROUPING' 'SETS' '(' GroupingSet ( ',' GroupingSet )* ')' | ExpressionList ( 'GROUPING' 'SETS' '(' GroupingSet ( ',' GroupingSet )* ')' )? ( 'WITH' 'ROLLUP' )? )
GroupingSet¶
Having¶
Having ::= 'HAVING' Expression
Qualify¶
Qualify ::= 'QUALIFY' Expression
OrderByElements¶
::= 'ORDER' 'SIBLINGS'? 'BY' OrderByElement ( ',' OrderByElement )*
OrderByElement¶
::= Expression ( 'ASC' | 'DESC' )? ( 'NULLS' ( 'FIRST' | 'LAST' )? )? ( 'WITH' 'ROLLUP' )?
JdbcParameter¶
::= ( '?' | S_PARAMETER ) S_LONG?
LimitWithOffset¶
::= 'LIMIT' Expression ',' Expression
PlainLimit¶
::= 'LIMIT' ( ParenthesedSelect | Expression )
LimitBy¶
Offset¶
Offset ::= 'OFFSET' Expression ( 'ROWS' | 'ROW' )?
Fetch¶
Fetch ::= 'FETCH' ( 'FIRST' | 'NEXT' ) ( Expression 'PERCENT'? )? ( 'ROWS' | 'ROW' ) ( 'ONLY' | 'WITH TIES' )
WithIsolation¶
::= 'WITH' K_ISOLATION
OptimizeFor¶
::= 'OPTIMIZE' 'FOR' S_LONG 'ROWS'
Top¶
Top ::= 'TOP' ( S_LONG | JdbcParameter | ':' S_IDENTIFIER? | '(' AdditiveExpression ')' ) 'PERCENT'? 'WITH TIES'?
Skip¶
First¶
Expression¶
::= XorExpression
XorExpression¶
::= OrExpression ( 'XOR' OrExpression )*
OrExpression¶
::= AndExpression ( 'OR' AndExpression )*
AndExpression¶
::= ( Condition | ( 'NOT' | '!' )? '(' XorExpression ')' ) ( ( 'AND' | '&&' ) ( Condition | ( 'NOT' | '!' )? '(' XorExpression ')' ) )*
Condition¶
::= ( 'NOT' | '!' )? ( RegularCondition | SQLCondition )
OverlapsCondition¶
::= ParenthesedExpressionList 'OVERLAPS' ParenthesedExpressionList
RegularCondition¶
::= 'PRIOR'? ComparisonItem ( '(' '+' ')' )? ( '>' | '<' | '=' | OP_GREATERTHANEQUALS | OP_MINORTHANEQUALS | OP_NOTEQUALSSTANDARD | OP_NOTEQUALSBANG | '*=' | '=*' | '&&' | '&>' | '<&' | '@@' | '~' | '~*' | '!~' | '!~*' | '@>' | '<@'
| '?' | '?|' | '?&' | OP_CONCAT | '-' | '-#' | '<->' | '<#>' ) 'PRIOR'? ComparisonItem ( '(' '+' ')' )?
SQLCondition¶
::= ExistsExpression
InExpression¶
::= SimpleExpression ( '(' '+' ')' )? 'GLOBAL'? 'NOT'? 'IN' ( S_CHAR_LITERAL | Function | ParenthesedSelect | ParenthesedExpressionList | SimpleExpression )
IncludesExpression¶
::= 'INCLUDES' ParenthesedExpressionList
ExcludesExpression¶
::= 'EXCLUDES' ParenthesedExpressionList
Between¶
Between ::= 'NOT'? 'BETWEEN' ( ParenthesedSelect | RegularCondition | SimpleExpression ) 'AND' ( ParenthesedSelect | RegularCondition | SimpleExpression )
LikeExpression¶
::= 'NOT'? ( 'LIKE' | 'ILIKE' | 'RLIKE' | 'REGEXP_LIKE' | 'REGEXP' | K_SIMILAR_TO ) 'BINARY'? SimpleExpression ( 'ESCAPE' ( S_CHAR_LITERAL | Expression ) )?
SimilarToExpression¶
::= 'NOT'? 'SIMILAR' 'TO' SimpleExpression ( 'ESCAPE' S_CHAR_LITERAL )?
IsDistinctExpression¶
::= 'IS' 'NOT'? 'DISTINCT' 'FROM' SimpleExpression
IsNullExpression¶
::= 'NOT'? 'ISNULL'
| 'NOTNULL'
| 'IS' 'NOT'? 'NULL'
IsBooleanExpression¶
::= 'IS' 'NOT'? ( 'TRUE' | 'FALSE' )
ExistsExpression¶
::= 'EXISTS' SimpleExpression
MemberOfExpression¶
::= 'MEMBER' 'OF' Expression
ExpressionList¶
ParenthesedExpressionList¶
::= '(' ( ComplexExpressionList | SimpleExpressionList )? ')'
SimpleExpressionList¶
ColumnList¶
ParenthesedColumnList¶
::= '(' ColumnList ')'
ComplexExpressionList¶
::= ( OracleNamedFunctionParameter | Expression ) ( ',' ( OracleNamedFunctionParameter | LambdaExpression | Expression ) )*
NamedExpressionListExprFirst¶
::= SimpleExpression ( 'FROM' | 'IN' | 'PLACING' ) SimpleExpression ( ( 'FOR' | 'FROM' ) SimpleExpression ( 'FOR' SimpleExpression )? )?
ComparisonItem¶
AnyComparisonExpression¶
::= ( 'ANY' | 'SOME' | 'ALL' ) ParenthesedSelect
SimpleExpression¶
::= ( UserVariable ( '=' | ':=' ) )? ConcatExpression
ConcatExpression¶
BitwiseAndOr¶
::= AdditiveExpression ( ( '|' | '&' | '<<' | '>>' ) AdditiveExpression )*
AdditiveExpression¶
::= MultiplicativeExpression ( ( '+' | '-' ) MultiplicativeExpression )*
MultiplicativeExpression¶
::= BitwiseXor ( ( '*' | '/' | 'DIV' | '%' ) BitwiseXor )*
BitwiseXor¶
::= PrimaryExpression ( '^' PrimaryExpression )*
ArrayExpression¶
::= ( '[' SimpleExpression? ( ':' SimpleExpression? )? ']' )+
PrimaryExpression¶
::= ( 'NOT' | '!' )? ( '+' | '-' | '~' )? ( 'NULL' | CaseWhenExpression | CharacterPrimary | ImplicitCast | JdbcParameter | JdbcNamedParameter | UserVariable | NumericBind | ExtractExpression | MySQLGroupConcat | XMLSerializeExpr | JsonFunction | JsonAggregateFunction | FullTextSearch | Function AnalyticExpression? | IntervalExpression | S_DOUBLE | S_LONG | S_HEX | CastExpression | K_TIME_KEY_EXPR | 'CURRENT' | DateTimeLiteralExpression | StructType | 'ARRAY'? ArrayConstructor | NextValExpression | ConnectByRootOperator | 'ALL' | Column | S_CHAR_LITERAL | ( '{d' | '{t' | '{ts' ) S_CHAR_LITERAL '}' | Select | ParenthesedSelect | ParenthesedExpressionList ( '->' Expression )? ( '.' RelObjectNameExt )? ) ( 'COLLATE' S_IDENTIFIER )? IntervalExpressionWithoutInterval? ArrayExpression? ( '::' ColDataType )* ( ( ( '->' | '->>' ) ( S_CHAR_LITERAL | S_LONG ) | ( '#>' | '#>>' ) S_CHAR_LITERAL )+ JsonExpression )? ( 'AT' K_DATETIMELITERAL 'ZONE' PrimaryExpression )*
ConnectByRootOperator¶
::= 'CONNECT_BY_ROOT' Column
NextValExpression¶
JdbcNamedParameter¶
::= ( ':' | '&' ) IdentifierChain
OracleNamedFunctionParameter¶
::= ( RelObjectNameExt2 | 'OUTER' ) '=>' Expression
UserVariable¶
::= ( '@' | '@@' ) IdentifierChain
NumericBind¶
::= ':' S_LONG
DateTimeLiteralExpression¶
RangeExpression¶
::= ':' Expression
ArrayConstructor¶
::= '[' ( ( Expression RangeExpression? | ArrayConstructor ) ( ',' ( Expression RangeExpression? | ArrayConstructor ) )* )? ']'
StructParameters¶
StructType¶
::= 'STRUCT' ( '<' StructParameters '>' )? '(' SelectItemsList ')'
| '{' RelObjectName ':' Expression ( ',' RelObjectName ':' Expression )* '}' ( '::' 'STRUCT' '(' StructParameters ')' )*
JsonExpression¶
::= ( ( '::' ColDataType )+ ( ( '->' | '->>' ) ( S_CHAR_LITERAL | S_LONG ) | ( '#>' | '#>>' ) S_CHAR_LITERAL )* )*
JsonFunction¶
::= ( 'JSON_OBJECT' '(' ( 'KEY'? S_CHAR_LITERAL ( ( ':' | ',' | 'VALUE' ) Expression ( 'FORMAT' 'JSON' )? )? ( ',' 'KEY'? S_CHAR_LITERAL ( ':' | ',' | 'VALUE' ) Expression ( 'FORMAT' 'JSON' )? )* )? ( ( 'NULL' | 'ABSENT' ) 'ON' 'NULL' )? ( ( 'WITH' | 'WITHOUT'
) 'UNIQUE' 'KEYS' )? | 'JSON_ARRAY' '(' ( 'NULL' 'ON' 'NULL' | Expression ( 'FORMAT' 'JSON' )? ( ',' Expression ( 'FORMAT' 'JSON' )? )* )* ( 'ABSENT' 'ON' 'NULL' )? ) ')'
JsonAggregateFunction¶
::= ( 'JSON_OBJECTAGG' '(' 'KEY'? ( DT_ZONE | S_DOUBLE | S_LONG | S_HEX | S_CHAR_LITERAL | S_IDENTIFIER | S_QUOTED_IDENTIFIER ) ( ':' | 'VALUE' ) ( S_IDENTIFIER | S_QUOTED_IDENTIFIER ) ( 'FORMAT' 'JSON' )? ( ( 'NULL' | 'ABSENT' ) 'ON' 'NULL' )? ( ( 'WITH' | 'WITHOUT'
) 'UNIQUE' 'KEYS' )? | 'JSON_ARRAYAGG' '(' Expression ( 'FORMAT' 'JSON' )? OrderByElements? ( ( 'NULL' | 'ABSENT' ) 'ON' 'NULL' )? ) ')' ( 'FILTER' '(' 'WHERE' Expression ')' )? ( 'OVER' '(' ( 'PARTITION' 'BY' ( ComplexExpressionList | '(' ComplexExpressionList ')' ) )? OrderByElements? WindowElement? ')' )?
IntervalExpression¶
::= 'INTERVAL' '-'? ( S_LONG | S_DOUBLE | S_CHAR_LITERAL | JdbcParameter | JdbcNamedParameter | Function | Column ) ( S_IDENTIFIER | K_DATE_LITERAL )?
IntervalExpressionWithoutInterval¶
::= K_DATE_LITERAL
KeepExpression¶
::= 'KEEP' '(' S_IDENTIFIER ( 'FIRST' | 'LAST' ) OrderByElements ')'
windowFun¶
::= ( 'OVER' | 'WITHIN' 'GROUP' ) ( RelObjectName | windowDefinition ( 'OVER' '(' ( 'PARTITION' 'BY' ( ComplexExpressionList | '(' ComplexExpressionList ')' ) )? ')' )? )
windowDefinition¶
::= '(' ( 'PARTITION' 'BY' ( ComplexExpressionList | '(' ComplexExpressionList ')' ) )? OrderByElements? WindowElement? ')'
AnalyticExpression¶
::= 'FILTER' '(' 'WHERE' Expression ')' windowFun?
WindowElement¶
::= ( 'ROWS' | 'RANGE' ) ( 'BETWEEN' WindowOffset 'AND' )? WindowOffset
WindowOffset¶
::= ( 'UNBOUNDED' | SimpleExpression ) ( 'PRECEDING' | 'FOLLOWING' )
| 'CURRENT' 'ROW'
ExtractExpression¶
ImplicitCast¶
CastExpression¶
::= ( 'CAST' | 'SAFE_CAST' | 'TRY_CAST' | 'INTERPRET' ) '(' SimpleExpression 'AS' ( 'ROW' '(' ColumnDefinition ( ',' ColumnDefinition )* ')' | ColDataType ) ( 'FORMAT' S_CHAR_LITERAL )? ')'
CaseWhenExpression¶
WhenThenSearchCondition¶
RowConstructor¶
::= 'ROW' ParenthesedExpressionList
VariableExpression¶
::= UserVariable '=' SimpleExpression
Execute¶
FullTextSearch¶
::= 'MATCH' '(' ColumnList ')' 'AGAINST' '(' ( S_CHAR_LITERAL | JdbcParameter | JdbcNamedParameter ) ( 'IN NATURAL LANGUAGE MODE' | 'IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION'
| 'IN BOOLEAN MODE' | 'WITH QUERY EXPANSION' )? ')'
LambdaExpression¶
Function¶
Function ::= '{' 'FN' InternalFunction '}'
SpecialStringFunctionWithNamedParameters¶
InternalFunction¶
::= 'APPROXIMATE'? RelObjectNames '(' ( ( 'DISTINCT' | 'ALL' | 'UNIQUE' )? ( '*' | AllTableColumns | ExpressionList OrderByElements? | Select ) )? ( 'HAVING' ( 'MIN' | 'MAX' ) Expression )? ( ( 'IGNORE' | 'RESPECT' ) 'NULLS' )? PlainLimit? ')' ( '.' ( Function | Column ) )? ( ( 'IGNORE' | 'RESPECT' ) 'NULLS' )? KeepExpression?
XMLSerializeExpr¶
::= 'XMLSERIALIZE' '(' 'XMLAGG' '(' 'XMLTEXT' '(' SimpleExpression ')' OrderByElements? ')' 'AS' ColDataType ')'
MySQLGroupConcat¶
::= 'GROUP_CONCAT' '(' 'DISTINCT'? ExpressionList OrderByElements? ( 'SEPARATOR' S_CHAR_LITERAL )? ')'
TableFunction¶
::= 'LATERAL'? Function
ColumnNamesWithParamsList¶
Index¶
Index ::= RelObjectNames
CreateIndex¶
::= CreateParameter? 'INDEX' ( 'IF' 'NOT' 'EXISTS' )? Index ( 'ON' Table ( 'USING' S_IDENTIFIER )? | ( 'USING' S_IDENTIFIER )? 'ON' Table ) ColumnNamesWithParamsList CreateParameter*
ColumnDefinition¶
CreateSchema¶
::= 'SCHEMA' ( 'IF' 'NOT' 'EXISTS' )? ( S_IDENTIFIER | S_QUOTED_IDENTIFIER )? ( 'AUTHORIZATION' ( S_IDENTIFIER | S_QUOTED_IDENTIFIER ) )? PathSpecification? ( 'CREATE' CreateTable | CreateView )*
PathSpecification¶
CreateTable¶
::= 'UNLOGGED'? 'GLOBAL'? CreateParameter* 'TABLE' ( 'IF' 'NOT' 'EXISTS' )? Table ( '(' ( RelObjectName ( ',' RelObjectName )* | ColumnDefinition ( ',' ( ( 'INDEX' | 'UNIQUE'? 'FULLTEXT'? 'KEY' ) RelObjectName ColumnNamesWithParamsList CreateParameter* | ( 'CONSTRAINT' RelObjectName )? ( ( 'PRIMARY' 'KEY' | 'UNIQUE' 'KEY'? ) ColumnNamesWithParamsList CreateParameter* | 'FOREIGN' 'KEY' ColumnNamesWithParamsList 'REFERENCES' Table ColumnsNamesList ( 'ON' ( 'DELETE' | 'UPDATE' ) Action )? ( 'ON' ( 'DELETE' | 'UPDATE' ) Action )? | 'CHECK' ( '(' Expression ')' )* ) | 'EXCLUDE' 'WHERE' ( '(' Expression ')' )* | ColumnDefinition ) )* ) ')' )? CreateParameter* RowMovement? ( 'AS' Select )? ( 'LIKE' ( '(' Table ')' | Table ) )? ( ',' SpannerInterleaveIn )?
SpannerInterleaveIn¶
::= 'INTERLEAVE' 'IN' 'PARENT' Table ( 'ON' 'DELETE' ( 'NO' 'ACTION' | 'CASCADE' ) )?
DataType¶
| 'ARRAY' '<' ColDataType '>'
| ( K_DATETIMELITERAL | DT_ZONE | DATA_TYPE | 'SIGNED' | 'UNSIGNED' | 'CHARACTER' | 'BIT' | 'BYTES' | 'BINARY' | 'CHAR' | 'JSON'
| 'STRING' ) ( DATA_TYPE | 'SIGNED' | 'UNSIGNED' | 'CHARACTER' | 'BIT' | 'BYTES' | 'BINARY' | 'CHAR' | 'JSON'
| 'STRING' )* ( '(' ( S_LONG | 'MAX' ) ( ',' S_LONG )? ')' )?
ColDataType¶
::= ( DataType | ( S_IDENTIFIER | S_QUOTED_IDENTIFIER | K_DATETIMELITERAL | K_DATE_LITERAL | 'XML' | 'INTERVAL' | DT_ZONE | 'CHAR' | 'SET' | 'BINARY' | 'JSON' | 'STRING' | 'PUBLIC' | 'DATA' ) ( '.' ColDataType )? ) ( '(' ( ( ( S_LONG | 'MAX' ) ( 'BYTE' | 'CHAR' )? | S_CHAR_LITERAL | S_IDENTIFIER | 'CHAR' ) ','? )* ')' )? ( '[' S_LONG? ']' )* ( 'CHARACTER' 'SET' ( S_IDENTIFIER | 'BINARY' ) )?
Analyze¶
CreateView¶
::= ( 'NO'? 'FORCE' )? 'SECURE'? ( 'TEMP' | 'TEMPORARY' | 'VOLATILE' )? 'MATERIALIZED'?
'VIEW' Table ( 'AUTO' 'REFRESH' ( 'YES' | 'NO' ) )? ( 'IF' 'NOT' 'EXISTS' )? ColumnWithCommentList? CreateViewTailComment? 'AS' Select ( 'WITH' 'READ' 'ONLY' )?
CreateViewTailComment¶
::= 'COMMENT' '='? S_CHAR_LITERAL
Action¶
Action ::= 'CASCADE'
| 'RESTRICT'
| 'NO' 'ACTION'
| 'SET' ( 'NULL' | 'DEFAULT' )
AlterView¶
CreateParameter¶
| ( 'USING' 'INDEX' )? 'TABLESPACE' RelObjectName
| 'NULL'
| 'NOT'
| 'PRIMARY'
| 'FOREIGN'
| 'REFERENCES'
| 'KEY'
| 'STORED'
| 'ON'
| 'COMMIT'
| 'DROP'
| 'ROWS'
| 'UNIQUE'
| 'CASCADE'
| 'DELETE'
| 'UPDATE'
| 'CONSTRAINT'
| 'WITH'
| 'EXCLUDE'
| 'WHERE'
| 'TEMP'
| 'TEMPORARY'
| 'PARTITION'
| 'BY'
| 'IN'
| 'TYPE'
| 'COMMENT'
| 'USING'
| 'COLLATE'
| 'ASC'
| 'DESC'
| 'TRUE'
| 'FALSE'
| 'PARALLEL'
| 'BINARY'
| 'START'
| 'RAW'
| 'HASH'
| 'FIRST'
| 'LAST'
| 'SIGNED'
| 'UNSIGNED'
| '='
| ( 'DEFAULT' | 'AS' | 'CHECK' ) ( '(' Expression ')' )?
| ( '+' | '-' )? S_LONG
| S_DOUBLE
| AList
| 'CHARACTER' 'SET'
| 'ARRAY' ArrayConstructor
| '::' ColDataType
RowMovement¶
::= ( 'ENABLE' | 'DISABLE' ) 'ROW' 'MOVEMENT'
AList¶
AList ::= '(' ( ( S_LONG | S_DOUBLE | S_CHAR_LITERAL | RelObjectNameWithoutValue ) ( ',' | '=' )? )* ')'
ColumnsNamesListItem¶
::= RelObjectName ( '(' S_LONG ')' )?
ColumnsNamesList¶
::= '(' ColumnsNamesListItem ( ',' ColumnsNamesListItem )* ')'
FuncArgsListItem¶
FuncArgsList¶
::= '(' ( FuncArgsListItem ( ',' FuncArgsListItem )* )? ')'
Drop¶
Drop ::= 'DROP' 'MATERIALIZED'? ( S_IDENTIFIER | 'TEMPORARY'? 'TABLE' | 'INDEX' | 'VIEW' | 'SCHEMA' | 'SEQUENCE' | 'FUNCTION' )
( 'IF' 'EXISTS' )? Table FuncArgsList? ( S_IDENTIFIER | 'CASCADE' | 'RESTRICT' | 'ON' )*
Truncate¶
AlterExpressionColumnDataType¶
AlterExpressionColumnDropNotNull¶
::= RelObjectName 'DROP' 'NOT'? 'NULL'
AlterExpressionColumnDropDefault¶
::= RelObjectName 'DROP' 'DEFAULT'
AlterExpressionConstraintState¶
::= ( 'NOT'? 'DEFERRABLE' | 'VALIDATE' | 'NOVALIDATE' | 'ENABLE' | 'DISABLE'
)*
IndexWithComment¶
::= 'COMMENT' S_CHAR_LITERAL
AlterExpression¶
::= ( 'ADD' | 'ALTER' | 'MODIFY' ) ( 'PRIMARY' 'KEY' ColumnsNamesList AlterExpressionConstraintState ( 'USING' RelObjectName )? | ( ( 'KEY' | 'INDEX' ) RelObjectName ColumnsNamesList AlterExpressionConstraintState | 'UNIQUE' ( ( 'KEY' | 'INDEX' ) ( S_IDENTIFIER | S_QUOTED_IDENTIFIER ) )? ColumnsNamesList ) ( 'USING' RelObjectName )? IndexWithComment? | RelObjectName 'COMMENT' S_CHAR_LITERAL | 'COLUMN'? ( 'IF' 'NOT' 'EXISTS' )? ( '(' AlterExpressionColumnDataType ( ',' AlterExpressionColumnDataType )* ')' | AlterExpressionColumnDataType | AlterExpressionColumnDropNotNull | AlterExpressionColumnDropDefault ) | '(' AlterExpressionColumnDataType ( ',' AlterExpressionColumnDataType )* ')' | 'FOREIGN' 'KEY' ColumnsNamesList 'REFERENCES' Table ColumnsNamesList? ( 'ON' ( 'DELETE' | 'UPDATE' ) Action )? ( 'ON' ( 'DELETE' | 'UPDATE' ) Action )? | 'CONSTRAINT' RelObjectName ( ( 'FOREIGN' 'KEY' ColumnsNamesList 'REFERENCES' Table ColumnsNamesList? ( 'ON' ( 'DELETE' | 'UPDATE' ) Action )? ( 'ON' ( 'DELETE' | 'UPDATE' ) Action )? | 'KEY' ColumnsNamesList ) AlterExpressionConstraintState | ( 'PRIMARY' 'KEY' | 'UNIQUE' ( 'KEY' | 'INDEX' )? ) ColumnsNamesList AlterExpressionConstraintState ( 'USING' RelObjectName )? IndexWithComment? | 'CHECK' ( '(' Expression ')' )* ) )
| 'DROP' ( ( ColumnsNamesList | 'COLUMN'? ( 'IF' 'EXISTS' )? ( S_IDENTIFIER | S_QUOTED_IDENTIFIER ) ) 'INVALIDATE'? ( 'CASCADE' 'CONSTRAINTS'? )? | ( 'INDEX' | 'KEY' ) ( S_IDENTIFIER | S_QUOTED_IDENTIFIER ) | ( ( 'UNIQUE' | 'FOREIGN' 'KEY' ) ColumnsNamesList | 'PRIMARY' 'KEY' | 'CONSTRAINT' ( 'IF' 'EXISTS' )? ( S_IDENTIFIER | S_QUOTED_IDENTIFIER ) ) ( 'CASCADE' | 'RESTRICT' )? )
| ( 'ALGORITHM' '='? | 'TRUNCATE' 'PARTITION' ) RelObjectName
| 'RENAME' ( ( 'COLUMN' | 'INDEX' | 'KEY' | 'CONSTRAINT' )? ( S_IDENTIFIER | S_QUOTED_IDENTIFIER ) )? 'TO' ( S_IDENTIFIER | S_QUOTED_IDENTIFIER )
| 'COMMENT' '='? S_CHAR_LITERAL
Alter¶
Alter ::= 'ALTER' ( AlterTable | AlterSession | AlterView | AlterSystemStatement | AlterSequence | captureRest )
| 'REPLACE' ( AlterView | captureRest )
AlterTable¶
AlterSession¶
::= 'SESSION' ( 'ADVISE' ( 'COMMIT' | 'ROLLBACK' | 'NOTHING' ) | 'CLOSE'
'DATABASE' 'LINK' | ( 'ENABLE' | 'DISABLE' ) ( 'COMMIT' 'IN' 'PROCEDURE' | 'GUARD'
| 'PARALLEL' ( 'DML' | 'DDL' | 'QUERY' ) | 'RESUMABLE' ) | 'FORCE' 'PARALLEL' ( 'DML'
| 'DDL' | 'QUERY' ) | 'SET' ) ( S_CHAR_LITERAL | S_IDENTIFIER | '=' | S_LONG | 'PARALLEL' )*
AlterSystemStatement¶
::= 'SYSTEM' ( 'ARCHIVE' 'LOG' | 'CHECKPOINT' | 'DUMP' 'ACTIVE' 'SESSION'
'HISTORY' | ( 'ENABLE' | 'DISABLE' ) ( 'DISTRIBUTED RECOVERY' | 'RESTRICTED SESSION'
) | 'FLUSH' | 'DISCONNECT' 'SESSION' | 'KILL SESSION' | 'SWITCH' | 'SUSPEND' | 'RESUME'
| 'QUIESCE' 'RESTRICTED' | 'UNQIESCE' | 'SHUTDOWN' | 'REGISTER' | 'SET' | 'RESET'
) captureRest
Wait¶
SavepointStatement¶
::= 'SAVEPOINT' S_IDENTIFIER
RollbackStatement¶
::= 'ROLLBACK' 'WORK'? ( 'TO' 'SAVEPOINT'? S_IDENTIFIER | 'FORCE' S_CHAR_LITERAL )?
Comment¶
Grant¶
Grant ::= 'GRANT' ( ( readGrantTypes ( ',' readGrantTypes )* )? 'ON' RelObjectNames | S_IDENTIFIER ) 'TO' UsersList
UsersList¶
::= RelObjectName ( ',' ColumnsNamesListItem )*
readGrantTypes¶
::= K_SELECT
| 'INSERT'
| 'UPDATE'
| 'DELETE'
| 'EXECUTE'
| 'ALTER'
| 'DROP'
Sequence¶
SequenceParameters¶
CreateSequence¶
::= 'SEQUENCE' Sequence SequenceParameters
AlterSequence¶
::= 'SEQUENCE' Sequence SequenceParameters
Create¶
Create ::= 'CREATE' ( 'OR' 'REPLACE' )? ( CreateFunctionStatement | CreateSchema | CreateSequence | CreateSynonym | CreateTable | CreateView | ( 'TRIGGER' | 'DOMAIN' )? captureRest | CreateIndex )
CreateFunctionStatement¶
::= ( 'FUNCTION' | 'PROCEDURE' ) captureFunctionBody
CreateSynonym¶
::= 'PUBLIC'? 'SYNONYM' Synonym 'FOR' RelObjectNames
Synonym¶
UnsupportedStatement¶
IdentifierChain¶
::= RelObjectNameExt2 ( '.' RelObjectNameExt2 )*
CharacterPrimary¶
TranscodingFunction¶
::= 'CONVERT' '(' ( ColDataType ',' Expression ( ',' S_LONG )? | Expression 'USING' IdentifierChain ) ')'
TrimFunction¶
::= 'TRIM' '(' ( 'LEADING' | 'TRAILING' | 'BOTH' )? Expression? ( ( ',' | 'FROM' ) Expression )? ')'
WHITESPACE¶
::= [ #x9#xD#xA]
K_DATETIMELITERAL¶
::= 'DATE'
| 'DATETIME'
| 'TIME'
| 'TIMESTAMP'
| 'TIMESTAMPTZ'
K_DATE_LITERAL¶
::= 'YEAR'
| 'MONTH'
| 'DAY'
| 'HOUR'
| 'MINUTE'
| 'SECOND'
K_ISOLATION¶
::= 'UR'
| 'RS'
| 'RR'
| 'CS'
K_NEXTVAL¶
::= 'NEXTVAL' ( ' '+ 'FOR' )?
| 'NEXT' ' '+ 'VALUE' ' '+ 'FOR'
K_SELECT¶
K_SELECT ::= 'SELECT'
| 'SEL'
K_TEXT_LITERAL¶
::= 'TEXT'
| 'TINYTEXT'
| 'MEDIUMTEXT'
| 'LONGTEXT'
K_TIME_KEY_EXPR¶
::= 'CURRENT' ( '_' | ' '+ ) ( 'TIMESTAMP' | 'TIME' | 'DATE' | 'TIMEZONE'
) '()'?
K_STRING_FUNCTION_NAME¶
::= 'SUBSTR'
| 'SUBSTRING'
| 'TRIM'
| 'POSITION'
| 'OVERLAY'
K_SIMILAR_TO¶
::= 'SIMILAR' ' '+ 'TO'
ST_SEMICOLON¶
::= ';'
| #xA ( [/#xA] | 'go' ) #xA
OP_GREATERTHANEQUALS¶
::= '>' WHITESPACE* '='
OP_MINORTHANEQUALS¶
::= '<' WHITESPACE* '='
OP_NOTEQUALSSTANDARD¶
::= '<' WHITESPACE* '>'
OP_NOTEQUALSBANG¶
::= '!' WHITESPACE* '='
OP_CONCAT¶
::= '|' WHITESPACE* '|'
DT_ZONE¶
DT_ZONE ::= K_DATETIMELITERAL WHITESPACE* ( '(' S_LONG ')' )? WHITESPACE* ( 'WITH' | 'WITHOUT' ) WHITESPACE+ ( 'LOCAL' WHITESPACE+ )? 'TIME' WHITESPACE+ 'ZONE'
DATA_TYPE¶
::= 'BISTRING'
| 'ENUM'
| 'UUID'
| 'MAP'
| 'HUGEINT'
| 'UTINYINT'
| 'USMALLINT'
| 'UINTEGER'
| 'UBIGINT'
| 'UHUGEINT'
| 'TIMETZ'
TYPE_BLOB¶
::= 'BLOB'
| 'BYTEA'
| 'BINARY'
| 'VARBINARY'
| 'BYTES'
TYPE_BOOLEAN¶
::= 'BOOLEAN'
| 'BOOL'
TYPE_DECIMAL¶
::= 'DECIMAL'
| 'NUMBER'
| 'NUMERIC'
TYPE_TINYINT¶
::= 'TINYINT'
| 'INT1'
TYPE_SMALLINT¶
::= 'SMALLINT'
| 'INT2'
| 'SHORT'
TYPE_INTEGER¶
::= 'INTEGER'
| 'INT'
| 'INT4'
| 'SIGNED'
| 'UNSIGNED'
TYPE_BIGINT¶
::= 'BIGINT'
| 'INT8'
| 'LONG'
TYPE_REAL¶
::= 'REAL'
| 'FLOAT4'
| 'FLOAT'
TYPE_DOUBLE¶
::= 'DOUBLE'
| 'PRECISION'
| 'FLOAT8'
| 'FLOAT64'
TYPE_VARCHAR¶
::= 'NVARCHAR'
| 'VARCHAR'
| 'NCHAR'
| 'CHAR'
| 'BPCHAR'
| 'TEXT'
| 'STRING'
| 'CHARACTER'
| 'VARYING'
TYPE_TIMESTAMP¶
::= 'TIMESTAMP_NS'
| 'TIMESTAMP_MS'
| 'TIMESTAMP_S'
S_DOUBLE¶
S_LONG¶
DIGIT¶
DIGIT ::= [0-9]
S_HEX¶
| '0x' HEX_VALUE+
HEX_VALUE¶
::= [0-9A-F ]
LINE_COMMENT¶
::= ( '--' | '//' ) [^#xD#xA]*
MULTI_LINE_COMMENT¶
::= '/*' [^*]* '*' ( ( [^*/] [^*]* )? '*' )* '/'
S_PARAMETER¶
::= '$' [0-9]+
S_IDENTIFIER¶
::= LETTER PART_LETTER*
LETTER¶
| Nd
| [$_#x23]
PART_LETTER¶
| [$_@#x23]
UnicodeIdentifierStart¶
::= #xB7
| Ll
| Lm
| Lo
| Lt
| Lu
| Nl
| CJK
ColumnWithCommentList¶