- Legend:
- Symbol Meaning
- ------ ---------------------------------------------------
- :== Is defined as
- | Separates alternatives
- [] Optional entry
- {} Repetition zero or more times
- () Grouping
- "string" Reserved word
- 'string' Directive (recognized in context, not reserved)
- Tokens (terminals):
- -------------------------------------------------------------
- <identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' }
- <float_literal> :== ( <Digit> { <Digit> } ( ( '.' [ { <Digit> } [ 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ]]) | ( 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ))) | ( '.' <Digit> { <Digit> } [ 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ])
- <integer_literal> :== <Digit> { <Digit> }
- <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
- <quoted_temp_name> :== '"' '<' { <identChars> } '>' '"'
- <quoted_name> :== '"' { <identChars> } '"'
- <bracketed_binary_string_literal> :== '[' <HexDigit> <HexDigit> { <HexDigit> <HexDigit> } ']'
- <comment1> :== '/' '/' { <noEol> } <cr>
- <comment2> :== '-' '-' { <noEol> } <cr>
- <comment3> :== '/' '*' { <noStar> | '*' <noSlash> } '*' '/'
- <white_space> :== ' ' | <tab> | <cr> | <lf> { ' ' | <tab> | <cr> | <lf> }
- Productions (non-terminals):
- -------------------------------------------------------------
- <Aggregate_factor> :== ( "COUNT" '(' ( '*' | [ ( "ALL" | "DISTINCT" ) ] <SimpleExpression> ) ')' | ( "MIN" | "MAX" | "SUM" | "AVG" | "MED" | "STD" | "LIST" ) '(' [ ( "ALL" | "DISTINCT" ) ] <SimpleExpression> ')' )
- <ALL_or_ANY_clause> :== ( "ALL" | "ANY" | "SOME" ) '(' <SELECTStatement> ')'
- <ALTER_statement> :== "ALTER" <AlterTableStatement>
- <AlterTableStatement> :== "TABLE" <SqlName> [ '.' <SqlName> ] ( 'ADD' ( [ "COLUMN" ] <Basetable_element> | <TableConstraint> ) | "ALTER" [ "COLUMN" ] <Column> ( "SET" "DEFAULT" <DefaultSpecifier> | "DROP" ( "DEFAULT" | "CONSTRAINT" "NOT" "NULL" ) | 'ADD' "CONSTRAINT" "NOT" "NULL" | "SET" 'DESCRIPTION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 | "CAST" [ "AS" ] <DataType> <IgnoreRestrict> | 'RENAME' [ "TO" ] <SqlName> <IgnoreRestrict> ) | "DROP" ( [ "COLUMN" <ExistsCheck> ] <Column> [ 'RESTRICT' ] | "CONSTRAINT" <ExistsCheck> <SqlName> [ 'RESTRICT' ] ) | "SET" 'DESCRIPTION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 | 'RENAME' [ "TO" ] <SqlName> <IgnoreRestrict> )
- <AnsiStringDataType> :== ( "TEXT" <OptionalIgnoredSizeSpec> | "CHARACTER" "LARGE" 'OBJECT' <OptionalIgnoredSizeSpec> | "CHAR" "LARGE" 'OBJECT' <OptionalIgnoredSizeSpec> | "CLOB" <OptionalIgnoredSizeSpec> | "SHORTSTRING" <OptionalSizeSpec> | ( "CHAR" [ "VARYING" ] | "CHARACTER" [ "VARYING" ] | "VARCHAR" ) <OptionalSizeSpec> | "SINGLECHAR" | "NULLSTRING" <OptionalSizeSpec> ) [ ( "CHARACTER" "SET" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 | 'CODEPAGE' <integer_literal> :== <Digit> { <Digit> } ) ]
- <ASSERT_statement> :== "ASSERT" "TABLE" <SqlName> '=' "TABLE" <SqlName> [ "IGNORE" "ORDER" ]
- <Basetable_element> :== <Column> <DataType> [ "DEFAULT" <DefaultSpecifier> ] [ "NOT" "NULL" ] { [ "CONSTRAINT" <SqlName> ] ( "PRIMARY" 'KEY' | "UNIQUE" | "CHECK" '(' <CondExp> ')' ) } [ [ "CONSTRAINT" <SqlName> ] "REFERENCES" <SqlName> [ '(' <Column> ')' ] { "ON" ( "UPDATE" <ReferenceAction> | "DELETE" <ReferenceAction> ) } ] [ 'DESCRIPTION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ]
- <BeginTransactionStatement> :== "START" 'TRANSACTION' [ ( 'SERIALIZABLE' | 'SNAPSHOT' ) ]
- <BETWEEN_clause> :== "BETWEEN" <SimpleExpression> "AND" <SimpleExpression>
- <BinaryDataType> :== ( "BLOB" <OptionalIgnoredSizeSpec> | "BINARY" "LARGE" 'OBJECT' <OptionalIgnoredSizeSpec> | "IMAGE" <OptionalIgnoredSizeSpec> | "BYTEARRAY" <SizeSpec> )
- <BLOBLiteral> :== ( 'X' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 { <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 } | <bracketed_binary_string_literal> :== '[' <HexDigit> <HexDigit> { <HexDigit> <HexDigit> } ']' )
- <BlobSwitch> :== '#B' <Switch>
- <Boolean_literal> :== ( "TRUE" | "FALSE" | "UNKNOWN" )
- <BooleanDataType> :== ( "BOOL" | "BOOLEAN" )
- <BreakStatement> :== "LEAVE"
- <CallStatement> :== "CALL" <SqlName> [ '.' <SqlName> ] '(' { <SimpleExpression> ',' } ')'
- <CASE_expression> :== ( <SimpleExpression> <SimpleWhenClauseList> | <WhenClauseList> ) [ "ELSE" ( "NULL" | <SimpleExpression> ) ] "END"
- <CAST_expression> :== '(' ( "NULL" | <SimpleExpression> ) "AS" <DataType> ')'
- <CheckConstraint> :== "CHECK" '(' <CondExp> ')'
- <COALESCE_expression> :== '(' <SimpleExpression> { ',' <SimpleExpression> } ')'
- <CollationOptions> :== [ ( "COLLATE" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 | "LOCALE" <integer_literal> :== <Digit> { <Digit> } ) <CompareFlags> ]
- <Column> :== <SqlName>
- <ColumnAlias> :== [ "AS" ] <Column>
- <ColumnNameList> :== <ColumnNameListItem> { ',' <ColumnNameListItem> }
- <ColumnNameListItem> :== <SqlName>
- <CommitTransactionStatement> :== "COMMIT" [ 'WORK' ]
- <CompareFlags> :== { "IGNORE" ( 'KANA' 'TYPE' | 'NONSPACE' | 'SYMBOLS' | 'WIDTH' ) } [ 'USE' 'STRING' 'SORT' ]
- <CompoundStatement> :== <StatementBlock>
- <CondExp> :== <CondTerm> { "OR" <CondTerm> }
- <CondFactor> :== [ "NOT" ] <CondPrimary>
- <CondPrimary> :== ( <ExistsClause> | <UniqueClause> | <ContainsClause> | <SimpleExpression> [ ( <Relation> | [ "NOT" ] <BETWEEN_clause> | [ "NOT" ] <LikeClause> | [ "NOT" ] <InClause> | <MatchClause> | <IsTest> ) ] )
- <CondTerm> :== <CondFactor> { "AND" <CondFactor> }
- <ConstraintColumnList> :== '(' <Column> { ',' <Column> } ')'
- <ContainsClause> :== "CONTAINS" '(' <SqlName> ',' <FullTextSearchExpr> ')'
- <ContinueStatement> :== "ITERATE"
- <CreateAssemblyStatement> :== "ASSEMBLY" <SqlName> [ "AUTHORIZATION" <SqlName> ] "FROM" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
- <CreateFunctionStatement> :== "FUNCTION" <SqlName> [ '.' <SqlName> ] '(' [ { <SqlName> [ "AS" ] <DataType> ',' } ] ')' "RETURNS" ( <DataType> | "TABLE" ) <RoutineCharacteristics> [ 'DESCRIPTION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ] [ "AS" ] ( <StatementBlock> | "RETURN" ( <ParenthesizedSelectStatement> | <CondExp> ) | "EXTERNAL" [ 'NAME' <SqlName> [ '.' <SqlName> [ '.' <SqlName> ] ] ] )
- <CreateIndexStatement> :== [ ( "UNIQUE" | "PRIMARY" ) ] "INDEX" <SqlName> "ON" <SqlName> [ '.' <SqlName> ] '(' <IndexElement> { ',' <IndexElement> } ')'
- <CreateProcedureStatement> :== "PROCEDURE" <SqlName> [ '.' <SqlName> ] '(' { <ParameterMode> <SqlName> <DataType> ',' } ')' <RoutineCharacteristics> [ 'DESCRIPTION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ] [ "AS" ] ( <StatementOrStatementBlock> | "EXTERNAL" [ 'NAME' <SqlName> [ '.' <SqlName> [ '.' <SqlName> ] ] ] )
- <CreateStatement> :== "CREATE" ( <CreateFunctionStatement> | <CreateIndexStatement> | <CreateProcedureStatement> | <CreateTableStatement> | <CreateTriggerStatement> | <CreateViewStatement> | <CreateAssemblyStatement> )
- <CreateTableStatement> :== [ ( "GLOBAL" | "LOCAL" ) 'TEMPORARY' ] "TABLE" <SqlName> [ '.' <SqlName> ] ( [ 'DESCRIPTION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ] [ ( 'BLOCKSIZE' | 'BLOCK' [ 'SIZE' ] ) <integer_literal> :== <Digit> { <Digit> } ] [ ( 'INITIALSIZE' | 'INITIAL' [ 'SIZE' ] ) <integer_literal> :== <Digit> { <Digit> } ] [ ( 'GROWSIZE' | 'GROW' [ 'SIZE' ] ) <integer_literal> :== <Digit> { <Digit> } ] [ 'STORAGE' [ 'ENGINE' ] <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ] [ 'ENCRYPTION' [ 'ENGINE' ] <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 [ 'ENCRYPT' "WITH" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ] ] [ "DEFAULT" ( "CHARACTER" "SET" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 | 'CODEPAGE' <integer_literal> :== <Digit> { <Digit> } ) ] [ "DEFAULT" ( 'COLLATION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 | "LOCALE" <integer_literal> :== <Digit> { <Digit> } ) <CompareFlags> ] '(' ( <Basetable_element> | <TableConstraint> | "LIKE" <SqlName> [ '.' <SqlName> ] ) { ',' ( <Basetable_element> | <TableConstraint> | "LIKE" <SqlName> [ '.' <SqlName> ] ) } ')' | [ '(' <ColumnNameList> ')' ] "AS" '(' <SELECTStatement> ')' "WITH" [ "NO" ] 'DATA' )
- <CreateTriggerStatement> :== "TRIGGER" <SqlName> [ '.' <SqlName> ] ( 'BEFORE' | 'AFTER' ) ( "INSERT" | "UPDATE" [ "OF" <ColumnNameList> ] | "DELETE" ) { ',' ( "INSERT" | "UPDATE" [ "OF" <ColumnNameList> ] | "DELETE" ) } "ON" <SqlName> [ "REFERENCING" ( 'OLD' [ "ROW" ] [ "AS" ] <SqlName> | 'NEW' [ "ROW" ] [ "AS" ] <SqlName> ) { ( 'OLD' [ "ROW" ] [ "AS" ] <SqlName> | 'NEW' [ "ROW" ] [ "AS" ] <SqlName> ) } ] [ 'DESCRIPTION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ] [ "AS" ] [ "FOR" "EACH" "ROW" ] [ "WHEN" '(' <CondExp> ')' ] <StatementOrStatementBlock>
- <CreateViewStatement> :== 'VIEW' <SqlName> [ '.' <SqlName> ] [ '(' <ColumnNameList> ')' ] [ 'DESCRIPTION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ] "AS" <TableExp1>
- <CustomSwitch> :== '#OPT' '::' <identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' } '::' <identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' } [ '=' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ]
- <DataType> :== ( <NumericDataType> | <StringDataType> | <DateTimeDataType> | <BooleanDataType> | <BinaryDataType> | <SpecialDataType> )
- <DateLiteral> :== "DATE" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
- <DateTimeDataType> :== ( "DATE" | "TIME" | "DATETIME" | "TIMESTAMP" )
- <DeclareStatement> :== "DECLARE" <identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' } { ','<identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' } } <DataType> [ "DEFAULT" <DefaultSpecifier> ]
- <DefaultSpecifier> :== ( "NULL" | <SignedLiteral> | "EMPTY" | 'CURRENT_DATE' | 'CURRENT_TIME' | 'LOCALTIME' | 'CURRENT_TIMESTAMP' | 'LOCALTIMESTAMP' | 'NEWGUID' | 'CURRENT_USER' | 'USER' | 'SESSION_USER' )
- <DeleteStatement> :== "DELETE" "FROM" <SimpleTableRef> [ "WHERE" <CondExp> ]
- <DeterministicCharacteristic> :== [ "NOT" ] "DETERMINISTIC"
- <DropRoutineStatement> :== ( 'ROUTINE' | "PROCEDURE" | "FUNCTION" ) <ExistsCheck> <SqlName> [ '.' <SqlName> ] [ 'RESTRICT' ] [ 'NORESTRICT' ]
- <DropStatement> :== "DROP" ( "TABLE" <ExistsCheck> <SqlName> [ '.' <SqlName> ] [ 'RESTRICT' ] | "INDEX" <ExistsCheck> <SqlName> '.' <SqlName> [ '.' <SqlName> ] | <DropRoutineStatement> | "TRIGGER" <ExistsCheck> <SqlName> [ '.' <SqlName> ] | 'VIEW' <ExistsCheck> <SqlName> [ '.' <SqlName> ] [ 'RESTRICT' ] | "ASSEMBLY" <ExistsCheck> <SqlName> )
- <ExistsCheck> :== [ "IF" "EXISTS" ]
- <ExistsClause> :== "EXISTS" '(' <SELECTStatement> ')'
- <Factor> :== [ '-' ] <PositiveFactor>
- <FieldRef> :== <SqlName> [ '.' ( <SqlName> [ '.' <SqlName> ] | '*' ) ] [ <FunctionArguments> ]
- <FloatLiteral> :== <float_literal> :== ( <Digit> { <Digit> } ( ( '.' [ { <Digit> } [ 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ]]) | ( 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ))) | ( '.' <Digit> { <Digit> } [ 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ])
- <ForeignColumnList> :== '(' <Column> { ',' <Column> } ')'
- <ForeignKeyConstraint> :== "FOREIGN" 'KEY' <ConstraintColumnList> "REFERENCES" <SqlName> [ <ForeignColumnList> ] { "ON" ( "UPDATE" <ReferenceAction> | "DELETE" <ReferenceAction> ) }
- <FullTextSearchExpr> :== { <FullTextSearchTerm> "OR" }
- <FullTextSearchFactor> :== [ "NOT" ] <SimpleExpression>
- <FullTextSearchTerm> :== { <FullTextSearchFactor> "AND" }
- <FunctionArguments> :== '(' { <SimpleExpression> ',' } ')'
- <FunctionCallStatement> :== <SqlName> '(' { <SimpleExpression> ',' } ')'
- <GroupColumn> :== <SqlName> [ '.' <SqlName> ] <CollationOptions>
- <GroupColumnList> :== <GroupColumn> { ',' <GroupColumn> }
- <GuidLiteral> :== "GUID" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
- <IfStatement> :== "IF" <CondExp> "THEN" <NakedStatementBlock> { "ELSEIF" <CondExp> "THEN" <NakedStatementBlock> } [ "ELSE" <NakedStatementBlock> ] "END" "IF"
- <IgnoreRestrict> :== ( "IGNORE" | 'RESTRICT' )
- <InClause> :== "IN" '(' ( <SELECTStatement> | <SimpleExpressionList> ) ')'
- <IndexElement> :== <Column> <SortingOptions>
- <IndexSwitch> :== '#I' <Switch>
- <InsertStatement> :== "INSERT" "INTO" <SqlName> [ '.' <SqlName> ] ( "DEFAULT" "VALUES" | [ '(' <ColumnNameList> ')' ] ( <TableConstructor> | <TableExp1> ) )
- <IntegerLiteral> :== <integer_literal> :== <Digit> { <Digit> }
- <IntervalLiteral> :== "INTERVAL" [ ( '+' | '-' ) ] <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 <YMDHMS> [ "TO" <YMDHMS> ]
- <IsTest> :== "IS" [ "NOT" ] ( "NULL" | "TRUE" | "FALSE" | "UNKNOWN" )
- <JoinTableExp> :== ( "CROSS" "JOIN" <SimpleTableRefOrParenTableExp> | [ "NATURAL" ] [ ( "INNER" | "LEFT" [ 'OUTER' ] | "RIGHT" [ 'OUTER' ] | "FULL" [ 'OUTER' ] ) ] "JOIN" <SimpleTableRefOrParenTableExp> [ ( "ON" <CondExp> | "USING" '(' <UsingList> ')' ) ] )
- <LanguageClause> :== "LANGUAGE" ( "SQL" | 'CLR' )
- <LikeClause> :== "LIKE" <SimpleExpression> [ "ESCAPE" <SimpleExpression> ] [ "IGNORE" "CASE" ]
- <Literal> :== ( <StringLiteral> | <IntegerLiteral> | <FloatLiteral> | <Boolean_literal> | <DateLiteral> | <TimeLiteral> | <TimestampLiteral> | <IntervalLiteral> | <BLOBLiteral> | <GuidLiteral> | <UnicodeLiteral> | "NULL" )
- <LogStatement> :== 'LOGMESSAGE' '(' { <SimpleExpression> ',' } ')'
- <LogSwitch> :== '#L' <Switch>
- <MatchClause> :== "MATCH" [ "UNIQUE" ] [ ( 'PARTIAL' | "FULL" | 'SIMPLE' ) ] '(' <SELECTStatement> ')'
- <NakedStatement> :== ( <InsertStatement> | <UpdateStatement> | <DeleteStatement> | <LogStatement> | <CreateStatement> | <DropStatement> | <ALTER_statement> | <ASSERT_statement> | <TableExp1> | <ReturnStatement> | <DeclareStatement> | <SetStatement> | <BreakStatement> | <ContinueStatement> | <IfStatement> | <WhileStatement> | <RepeatStatement> | <CallStatement> | <FunctionCallStatement> | <BeginTransactionStatement> | <CommitTransactionStatement> | <RollbackTransactionStatement> | <TryStatement> | <ThrowStatement> | <SetPasswordsStatement> | <CompoundStatement> )
- <NakedStatementAsBlock> :== <NakedStatement>
- <NakedStatementBlock> :== <NakedStatement> { ';' <NakedStatement> } ';'
- <NestedFactor> :== '(' ( <CondExp> | <SELECTStatement> ) ')'
- <NonJoinTableExp> :== <NonJoinTableTerm>
- <NonJoinTablePrimary> :== ( <SELECTStatement> | '(' <NonJoinTableExp> ')' | "TABLE" '(' <FunctionCallStatement> ')' )
- <NonJoinTableTerm> :== <NonJoinTablePrimary> { "INTERSECT" [ ( "ALL" | "DISTINCT" ) ] <NonJoinTablePrimary> }
- <NullCallClause> :== ( "RETURNS" "NULL" "ON" "NULL" 'INPUT' | "CALLED" "ON" "NULL" 'INPUT' )
- <NumericDataType> :== ( "TINYINT" | "BYTE" | "WORD" | "DWORD" | "INT" | "INTEGER" | "SMALLINT" | "SHORTINT" | "LARGEINT" | "BIGINT" | "AUTOINC" [ '(' <integer_literal> :== <Digit> { <Digit> } [ ',' <integer_literal> :== <Digit> { <Digit> } ] ')' ] | "FLOAT" <OptionalDecimalSpec> | "REAL" | "DOUBLE" "PRECISION" | "EXTENDED" | "MONEY" | "NUMERIC" <OptionalPrecisionScaleSpec> | "DECIMAL" <OptionalPrecisionScaleSpec> | "DEC" <OptionalPrecisionScaleSpec> )
- <nxSQL> :== { ( <LogSwitch> | <TimeoutSwitch> | <CustomSwitch> | <VerboseSwitch> ) } [ <Statement> ] { ';' [ <Statement> ] } [ ';' ] <eof>
- <OptionalDecimalSpec> :== [ '(' <integer_literal> :== <Digit> { <Digit> } ')' ]
- <OptionalIgnoredSizeSpec> :== [ '(' <integer_literal> :== <Digit> { <Digit> } ')' ]
- <OptionalPrecisionScaleSpec> :== [ '(' <integer_literal> :== <Digit> { <Digit> } [ ',' <integer_literal> :== <Digit> { <Digit> } ] ')' ]
- <OptionalSizeSpec> :== [ '(' <integer_literal> :== <Digit> { <Digit> } ')' ]
- <OrderColumn> :== <SqlName> [ '.' <SqlName> ]
- <OrderItem> :== ( <OrderColumn> | <integer_literal> :== <Digit> { <Digit> } ) <SortingOptions>
- <OrderList> :== <OrderItem> { ',' <OrderItem> }
- <ParameterMode> :== [ ( "IN" | "OUT" | "INOUT" ) ]
- <ParenthesizedSelectStatement> :== ( '(' <ParenthesizedSelectStatement> ')' | <SELECTStatement> )
- <PasswordList> :== <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 { ','<character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 }
- <PositiveFactor> :== ( <Literal> | <FieldRef> | <ScalarFunction> | <Aggregate_factor> | <NestedFactor> | '?' | ':' <SqlName> )
- <PrimaryKeyConstraint> :== "PRIMARY" 'KEY' <ConstraintColumnList>
- <ReferenceAction> :== ( 'CASCADE' | 'RESTRICT' | "SET" "NULL" | "SET" "DEFAULT" )
- <Relation> :== <RelationalOperator> ( <ALL_or_ANY_clause> | <SimpleExpression> )
- <RelationalOperator> :== ( '=' | '<=' | '<' | '>' | '>=' | '<>' | '%' | '%%' )
- <RepeatStatement> :== "REPEAT" <NakedStatementBlock> "UNTIL" <CondExp> "END" "REPEAT"
- <ReturnParenthesizedSelectStatement> :== ( '(' <ReturnParenthesizedSelectStatement> ')' | <TableExp1> )
- <ReturnStatement> :== "RETURN" [ ( <CondExp> | <ReturnParenthesizedSelectStatement> ) ]
- <RollbackTransactionStatement> :== "ROLLBACK" [ 'WORK' ]
- <RoutineCharacteristic> :== ( <LanguageClause> | <DeterministicCharacteristic> | <SQLDataAccessIndication> | <NullCallClause> )
- <RoutineCharacteristics> :== { <RoutineCharacteristic> }
- <ScalarFunction> :== ( "CASE" <CASE_expression> | "CAST" <CAST_expression> | ( "CHARACTER_LENGTH" | "CHAR_LENGTH" ) '(' <SimpleExpression> [ "USING" ( 'CHARACTERS' | 'OCTETS' ) ] ')' | "OCTET_LENGTH" '(' <SimpleExpression> ')' | "COALESCE" <COALESCE_expression> | "EXTRACT" '(' <YMDHMS> "FROM" <SimpleExpression> ')' | "NULLIF" '(' <SimpleExpression> ',' <SimpleExpression> ')' | "POSITION" '(' <SimpleExpression> "IN" <SimpleExpression> [ "USING" ( 'CHARACTERS' | 'OCTETS' ) ] ')' | "SUBSTRING" '(' <SimpleExpression> "FROM" <SimpleExpression> [ "FOR" <SimpleExpression> ] [ "USING" ( 'CHARACTERS' | 'OCTETS' ) ] ')' | "SYSTEM_ROW_35_" | "TRIM" '(' [ ( "LEADING" | "TRAILING" | "BOTH" ) ] [ <SimpleExpression> ] [ "FROM" <SimpleExpression> ] ')' )
- <Selection> :== ( '*' | <CondExp> [ <ColumnAlias> ] )
- <SelectionList> :== <Selection> { ',' <Selection> }
- <SELECTStatement> :== "SELECT" [ ( "ALL" | "DISTINCT" ) ] [ 'TOP' <integer_literal> :== <Digit> { <Digit> } [ 'PERCENT' ] [ ',' <integer_literal> :== <Digit> { <Digit> } ] ] <SelectionList> [ "INTO" <SqlName> [ '.' <SqlName> ] ] "FROM" <TableRefList> [ "WHERE" <CondExp> ] [ "GROUP" "BY" <GroupColumnList> ] [ "HAVING" <CondExp> ] [ "ORDER" "BY" <OrderList> ]
- <SetPasswordsStatement> :== "SET" "PASSWORDS" [ [ ( 'ADD' | 'REMOVE' ) ] <PasswordList> ]
- <SetStatement> :== "SET" <SqlName> [ '.' <SqlName> ] '=' ( "NULL" | "DEFAULT" | <CondExp> )
- <SignedIntegerLiteral> :== [ '-' ] <integer_literal> :== <Digit> { <Digit> }
- <SignedLiteral> :== ( <FloatLiteral> | <SignedIntegerLiteral> | <StringLiteral> | <DateLiteral> | <TimeLiteral> | <TimestampLiteral> | <IntervalLiteral> | <Boolean_literal> | <BLOBLiteral> | <GuidLiteral> | "NULL" )
- <SimpleAlias> :== [ "AS" ] <SqlName>
- <SimpleExpression> :== <Term> { ( '+' | '-' | '||' ) <Term> }
- <SimpleExpressionList> :== <SimpleExpression> { ',' <SimpleExpression> }
- <SimpleTableRef> :== ( <SqlName> [ '.' <SqlName> ] [ <SimpleAlias> ] | "TABLE" '(' <SqlName> '(' { <SimpleExpression> ',' } ')' ')' <SimpleAlias> )
- <SimpleTableRefOrParenTableExp> :== ( <SimpleTableRef> | '(' <TableExp1> ')' [ <SimpleAlias> ] )
- <SimpleWhenClause> :== "WHEN" <SimpleExpression> "THEN" ( "NULL" | <SimpleExpression> )
- <SimpleWhenClauseList> :== <SimpleWhenClause> { <SimpleWhenClause> }
- <SimplifySwitch> :== '#S' <Switch>
- <SizeSpec> :== '(' <integer_literal> :== <Digit> { <Digit> } ')'
- <SortingOptions> :== <CollationOptions> { "IGNORE" "CASE" } [ ( 'ASC' | 'DESC' ) ] [ ( 'NULLS' ( 'FIRST' | 'LAST' | 'ONLY' ) | "NO" 'NULLS' ) ]
- <SpecialDataType> :== ( "RECREV" | "GUID" )
- <SQLDataAccessIndication> :== ( "NO" "SQL" | "CONTAINS" "SQL" | "READS" "SQL" 'DATA' | "MODIFIES" "SQL" 'DATA' )
- <SqlName> :== ( <identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' } | <quoted_name> :== '"' { <identChars> } '"' | <quoted_temp_name> :== '"' '<' { <identChars> } '>' '"' )
- <Statement> :== { ( <BlobSwitch> | <IndexSwitch> | <SimplifySwitch> ) } <NakedStatement>
- <StatementBlock> :== "BEGIN" [ [ "NOT" ] "ATOMIC" ] <NakedStatementBlock> "END"
- <StatementOrStatementBlock> :== ( <StatementBlock> | <NakedStatementAsBlock> )
- <StringDataType> :== ( <AnsiStringDataType> | <UnicodeStringDataType> ) [ ( "COLLATE" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 | "LOCALE" <integer_literal> :== <Digit> { <Digit> } ) <CompareFlags> ]
- <StringLiteral> :== [ 'N' ] <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 { [ 'N' ] <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 }
- <Switch> :== ( '+' | '-' )
- <TableConstraint> :== [ "CONSTRAINT" <SqlName> ] ( <PrimaryKeyConstraint> | <UniqueKeyConstraint> | <ForeignKeyConstraint> | <CheckConstraint> )
- <TableConstructor> :== "VALUES" '(' <ValueList> ')' { ',''(' <ValueList> ')' }
- <TableExp1> :== ( <SimpleTableRefOrParenTableExp> <JoinTableExp> { <JoinTableExp> } [ <SimpleAlias> ] | <NonJoinTableExp> | '(' <TableExp1> ')' [ <SimpleAlias> ] ) { ( "UNION" | "EXCEPT" ) [ ( "ALL" | "DISTINCT" ) ] <NonJoinTableTerm> }
- <TableExp2> :== ( <SimpleTableRefOrParenTableExp> <JoinTableExp> { <JoinTableExp> } [ <SimpleAlias> ] | '(' <TableExp1> ')' [ <SimpleAlias> ] )
- <TableRef> :== ( <TableExp2> | <SimpleTableRef> ) [ '(' <ColumnNameList> ')' ]
- <TableRefList> :== <TableRef> { ',' <TableRef> }
- <Term> :== <Factor> { ( '*' | '/' ) <Factor> }
- <ThrowStatement> :== "SIGNAL" <SimpleExpression>
- <TimeLiteral> :== "TIME" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
- <TimeoutSwitch> :== '#T' <integer_literal> :== <Digit> { <Digit> }
- <TimestampLiteral> :== "TIMESTAMP" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
- <TryStatement> :== "TRY" <NakedStatementBlock> "CATCH" <CondExp> [ <NakedStatementBlock> ] { "CATCH" <CondExp> [ <NakedStatementBlock> ] } "END"
- <UnicodeLiteral> :== 'U' '&' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 { <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 } [ 'UESCAPE' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ]
- <UnicodeStringDataType> :== ( ( "NCHAR" [ "VARYING" ] | "NVARCHAR" | "NATIONAL" ( "CHARACTER" | "CHAR" ) [ "VARYING" ] ) <OptionalSizeSpec> | "NTEXT" <OptionalIgnoredSizeSpec> | "NATIONAL" "CHARACTER" "LARGE" 'OBJECT' <OptionalIgnoredSizeSpec> | "NCHAR" "LARGE" 'OBJECT' <OptionalIgnoredSizeSpec> | "NCLOB" <OptionalIgnoredSizeSpec> | "NSINGLECHAR" )
- <UniqueClause> :== "UNIQUE" '(' <TableExp1> ')'
- <UniqueKeyConstraint> :== "UNIQUE" <ConstraintColumnList>
- <UpdateItem> :== <SqlName> [ '.' <SqlName> ] '=' ( "NULL" | <SimpleExpression> | "DEFAULT" )
- <UpdateList> :== <UpdateItem> { ',' <UpdateItem> }
- <UpdateStatement> :== "UPDATE" <SimpleTableRef> "SET" <UpdateList> [ "WHERE" <CondExp> ]
- <UsingItem> :== <SqlName>
- <UsingList> :== <UsingItem> { ',' <UsingItem> }
- <ValueItem> :== ( "DEFAULT" | "NULL" | <SimpleExpression> )
- <ValueList> :== <ValueItem> { ',' <ValueItem> }
- <VerboseSwitch> :== '#V' <Switch>
- <WhenClause> :== "WHEN" <CondExp> "THEN" ( "NULL" | <SimpleExpression> )
- <WhenClauseList> :== <WhenClause> { <WhenClause> }
- <WhileStatement> :== "WHILE" <CondExp> "DO" <NakedStatementBlock> "END" "WHILE"
- <YMDHMS> :== ( "YEAR" | "MONTH" | "DAY" | "HOUR" | "MINUTE" | "SECOND" )