1. Legend:
  2.  
  3. Symbol    Meaning
  4. ------    ---------------------------------------------------
  5. :==       Is defined as
  6. |         Separates alternatives
  7. []        Optional entry
  8. {}        Repetition zero or more times
  9. ()        Grouping
  10. "string"  Reserved word
  11. 'string'  Directive (recognized in context, not reserved)
  12.  
  13. Tokens (terminals):
  14. -------------------------------------------------------------
  15. <identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' }
  16. <float_literal> :== ( <Digit> { <Digit> } ( ( '.' [ { <Digit> } [ 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ]]) | ( 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ))) | ( '.' <Digit> { <Digit> } [ 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ])
  17. <integer_literal> :== <Digit> { <Digit> }
  18. <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
  19. <quoted_temp_name> :== '"' '<' { <identChars> } '>' '"'
  20. <quoted_name> :== '"' { <identChars> } '"'
  21. <bracketed_binary_string_literal> :== '[' <HexDigit> <HexDigit> { <HexDigit> <HexDigit> } ']'
  22. <comment1> :== '/' '/' { <noEol> } <cr>
  23. <comment2> :== '-' '-' { <noEol> } <cr>
  24. <comment3> :== '/' '*' { <noStar> | '*' <noSlash> } '*' '/'
  25. <white_space> :== ' ' | <tab> | <cr> | <lf> { ' ' | <tab> | <cr> | <lf> }
  26.  
  27. Productions (non-terminals):
  28. -------------------------------------------------------------
  29. <Aggregate_factor> :== ( "COUNT" '(' ( '*' | [ ( "ALL" | "DISTINCT" ) ] <SimpleExpression> ) ')' | ( "MIN" | "MAX" | "SUM" | "AVG" | "MED" | "STD" | "LIST" ) '(' [ ( "ALL" | "DISTINCT" ) ] <SimpleExpression> ')' )
  30.  
  31. <ALL_or_ANY_clause> :== ( "ALL" | "ANY" | "SOME" ) '(' <SELECTStatement> ')'
  32.  
  33. <ALTER_statement> :== "ALTER" <AlterTableStatement>
  34.  
  35. <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> )
  36.  
  37. <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> } ) ]
  38.  
  39. <ASSERT_statement> :== "ASSERT" "TABLE" <SqlName> '=' "TABLE" <SqlName> [ "IGNORE" "ORDER" ]
  40.  
  41. <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 ]
  42.  
  43. <BeginTransactionStatement> :== "START" 'TRANSACTION' [ ( 'SERIALIZABLE' | 'SNAPSHOT' ) ]
  44.  
  45. <BETWEEN_clause> :== "BETWEEN" <SimpleExpression> "AND" <SimpleExpression>
  46.  
  47. <BinaryDataType> :== ( "BLOB" <OptionalIgnoredSizeSpec> | "BINARY" "LARGE" 'OBJECT' <OptionalIgnoredSizeSpec> | "IMAGE" <OptionalIgnoredSizeSpec> | "BYTEARRAY" <SizeSpec> )
  48.  
  49. <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> } ']' )
  50.  
  51. <BlobSwitch> :== '#B' <Switch>
  52.  
  53. <Boolean_literal> :== ( "TRUE" | "FALSE" | "UNKNOWN" )
  54.  
  55. <BooleanDataType> :== ( "BOOL" | "BOOLEAN" )
  56.  
  57. <BreakStatement> :== "LEAVE"
  58.  
  59. <CallStatement> :== "CALL" <SqlName> [ '.' <SqlName> ] '(' { <SimpleExpression> ',' } ')'
  60.  
  61. <CASE_expression> :== ( <SimpleExpression> <SimpleWhenClauseList> | <WhenClauseList> ) [ "ELSE" ( "NULL" | <SimpleExpression> ) ] "END"
  62.  
  63. <CAST_expression> :== '(' ( "NULL" | <SimpleExpression> ) "AS" <DataType> ')'
  64.  
  65. <CheckConstraint> :== "CHECK" '(' <CondExp> ')'
  66.  
  67. <COALESCE_expression> :== '(' <SimpleExpression> { ',' <SimpleExpression> } ')'
  68.  
  69. <CollationOptions> :== [ ( "COLLATE" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 | "LOCALE" <integer_literal> :== <Digit> { <Digit> } ) <CompareFlags> ]
  70.  
  71. <Column> :== <SqlName>
  72.  
  73. <ColumnAlias> :== [ "AS" ] <Column>
  74.  
  75. <ColumnNameList> :== <ColumnNameListItem> { ',' <ColumnNameListItem> }
  76.  
  77. <ColumnNameListItem> :== <SqlName>
  78.  
  79. <CommitTransactionStatement> :== "COMMIT" [ 'WORK' ]
  80.  
  81. <CompareFlags> :== { "IGNORE" ( 'KANA' 'TYPE' | 'NONSPACE' | 'SYMBOLS' | 'WIDTH' ) } [ 'USE' 'STRING' 'SORT' ]
  82.  
  83. <CompoundStatement> :== <StatementBlock>
  84.  
  85. <CondExp> :== <CondTerm> { "OR" <CondTerm> }
  86.  
  87. <CondFactor> :== [ "NOT" ] <CondPrimary>
  88.  
  89. <CondPrimary> :== ( <ExistsClause> | <UniqueClause> | <ContainsClause> | <SimpleExpression> [ ( <Relation> | [ "NOT" ] <BETWEEN_clause> | [ "NOT" ] <LikeClause> | [ "NOT" ] <InClause> | <MatchClause> | <IsTest> ) ] )
  90.  
  91. <CondTerm> :== <CondFactor> { "AND" <CondFactor> }
  92.  
  93. <ConstraintColumnList> :== '(' <Column> { ',' <Column> } ')'
  94.  
  95. <ContainsClause> :== "CONTAINS" '(' <SqlName> ',' <FullTextSearchExpr> ')'
  96.  
  97. <ContinueStatement> :== "ITERATE"
  98.  
  99. <CreateAssemblyStatement> :== "ASSEMBLY" <SqlName> [ "AUTHORIZATION" <SqlName> ] "FROM" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
  100.  
  101. <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> ] ] ] )
  102.  
  103. <CreateIndexStatement> :== [ ( "UNIQUE" | "PRIMARY" ) ] "INDEX" <SqlName> "ON" <SqlName> [ '.' <SqlName> ] '(' <IndexElement> { ',' <IndexElement> } ')'
  104.  
  105. <CreateProcedureStatement> :== "PROCEDURE" <SqlName> [ '.' <SqlName> ] '(' { <ParameterMode> <SqlName> <DataType> ',' } ')' <RoutineCharacteristics> [ 'DESCRIPTION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ] [ "AS" ] ( <StatementOrStatementBlock> | "EXTERNAL" [ 'NAME' <SqlName> [ '.' <SqlName> [ '.' <SqlName> ] ] ] )
  106.  
  107. <CreateStatement> :== "CREATE" ( <CreateFunctionStatement> | <CreateIndexStatement> | <CreateProcedureStatement> | <CreateTableStatement> | <CreateTriggerStatement> | <CreateViewStatement> | <CreateAssemblyStatement> )
  108.  
  109. <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' )
  110.  
  111. <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>
  112.  
  113. <CreateViewStatement> :== 'VIEW' <SqlName> [ '.' <SqlName> ] [ '(' <ColumnNameList> ')' ] [ 'DESCRIPTION' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ] "AS" <TableExp1>
  114.  
  115. <CustomSwitch> :== '#OPT' '::' <identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' } '::' <identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' } [ '=' <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 ]
  116.  
  117. <DataType> :== ( <NumericDataType> | <StringDataType> | <DateTimeDataType> | <BooleanDataType> | <BinaryDataType> | <SpecialDataType> )
  118.  
  119. <DateLiteral> :== "DATE" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
  120.  
  121. <DateTimeDataType> :== ( "DATE" | "TIME" | "DATETIME" | "TIMESTAMP" )
  122.  
  123. <DeclareStatement> :== "DECLARE" <identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' } { ','<identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' } } <DataType> [ "DEFAULT" <DefaultSpecifier> ]
  124.  
  125. <DefaultSpecifier> :== ( "NULL" | <SignedLiteral> | "EMPTY" | 'CURRENT_DATE' | 'CURRENT_TIME' | 'LOCALTIME' | 'CURRENT_TIMESTAMP' | 'LOCALTIMESTAMP' | 'NEWGUID' | 'CURRENT_USER' | 'USER' | 'SESSION_USER' )
  126.  
  127. <DeleteStatement> :== "DELETE" "FROM" <SimpleTableRef> [ "WHERE" <CondExp> ]
  128.  
  129. <DeterministicCharacteristic> :== [ "NOT" ] "DETERMINISTIC"
  130.  
  131. <DropRoutineStatement> :== ( 'ROUTINE' | "PROCEDURE" | "FUNCTION" ) <ExistsCheck> <SqlName> [ '.' <SqlName> ] [ 'RESTRICT' ] [ 'NORESTRICT' ]
  132.  
  133. <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> )
  134.  
  135. <ExistsCheck> :== [ "IF" "EXISTS" ]
  136.  
  137. <ExistsClause> :== "EXISTS" '(' <SELECTStatement> ')'
  138.  
  139. <Factor> :== [ '-' ] <PositiveFactor>
  140.  
  141. <FieldRef> :== <SqlName> [ '.' ( <SqlName> [ '.' <SqlName> ] | '*' ) ] [ <FunctionArguments> ]
  142.  
  143. <FloatLiteral> :== <float_literal> :== ( <Digit> { <Digit> } ( ( '.' [ { <Digit> } [ 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ]]) | ( 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ))) | ( '.' <Digit> { <Digit> } [ 'E' [ ( '+' | '-' )] <Digit> { <Digit> } ])
  144.  
  145. <ForeignColumnList> :== '(' <Column> { ',' <Column> } ')'
  146.  
  147. <ForeignKeyConstraint> :== "FOREIGN" 'KEY' <ConstraintColumnList> "REFERENCES" <SqlName> [ <ForeignColumnList> ] { "ON" ( "UPDATE" <ReferenceAction> | "DELETE" <ReferenceAction> ) }
  148.  
  149. <FullTextSearchExpr> :== { <FullTextSearchTerm> "OR" }
  150.  
  151. <FullTextSearchFactor> :== [ "NOT" ] <SimpleExpression>
  152.  
  153. <FullTextSearchTerm> :== { <FullTextSearchFactor> "AND" }
  154.  
  155. <FunctionArguments> :== '(' { <SimpleExpression> ',' } ')'
  156.  
  157. <FunctionCallStatement> :== <SqlName> '(' { <SimpleExpression> ',' } ')'
  158.  
  159. <GroupColumn> :== <SqlName> [ '.' <SqlName> ] <CollationOptions>
  160.  
  161. <GroupColumnList> :== <GroupColumn> { ',' <GroupColumn> }
  162.  
  163. <GuidLiteral> :== "GUID" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
  164.  
  165. <IfStatement> :== "IF" <CondExp> "THEN" <NakedStatementBlock> { "ELSEIF" <CondExp> "THEN" <NakedStatementBlock> } [ "ELSE" <NakedStatementBlock> ] "END" "IF"
  166.  
  167. <IgnoreRestrict> :== ( "IGNORE" | 'RESTRICT' )
  168.  
  169. <InClause> :== "IN" '(' ( <SELECTStatement> | <SimpleExpressionList> ) ')'
  170.  
  171. <IndexElement> :== <Column> <SortingOptions>
  172.  
  173. <IndexSwitch> :== '#I' <Switch>
  174.  
  175. <InsertStatement> :== "INSERT" "INTO" <SqlName> [ '.' <SqlName> ] ( "DEFAULT" "VALUES" | [ '(' <ColumnNameList> ')' ] ( <TableConstructor> | <TableExp1> ) )
  176.  
  177. <IntegerLiteral> :== <integer_literal> :== <Digit> { <Digit> }
  178.  
  179. <IntervalLiteral> :== "INTERVAL" [ ( '+' | '-' ) ] <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 <YMDHMS> [ "TO" <YMDHMS> ]
  180.  
  181. <IsTest> :== "IS" [ "NOT" ] ( "NULL" | "TRUE" | "FALSE" | "UNKNOWN" )
  182.  
  183. <JoinTableExp> :== ( "CROSS" "JOIN" <SimpleTableRefOrParenTableExp> | [ "NATURAL" ] [ ( "INNER" | "LEFT" [ 'OUTER' ] | "RIGHT" [ 'OUTER' ] | "FULL" [ 'OUTER' ] ) ] "JOIN" <SimpleTableRefOrParenTableExp> [ ( "ON" <CondExp> | "USING" '(' <UsingList> ')' ) ] )
  184.  
  185. <LanguageClause> :== "LANGUAGE" ( "SQL" | 'CLR' )
  186.  
  187. <LikeClause> :== "LIKE" <SimpleExpression> [ "ESCAPE" <SimpleExpression> ] [ "IGNORE" "CASE" ]
  188.  
  189. <Literal> :== ( <StringLiteral> | <IntegerLiteral> | <FloatLiteral> | <Boolean_literal> | <DateLiteral> | <TimeLiteral> | <TimestampLiteral> | <IntervalLiteral> | <BLOBLiteral> | <GuidLiteral> | <UnicodeLiteral> | "NULL" )
  190.  
  191. <LogStatement> :== 'LOGMESSAGE' '(' { <SimpleExpression> ',' } ')'
  192.  
  193. <LogSwitch> :== '#L' <Switch>
  194.  
  195. <MatchClause> :== "MATCH" [ "UNIQUE" ] [ ( 'PARTIAL' | "FULL" | 'SIMPLE' ) ] '(' <SELECTStatement> ')'
  196.  
  197. <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> )
  198.  
  199. <NakedStatementAsBlock> :== <NakedStatement>
  200.  
  201. <NakedStatementBlock> :== <NakedStatement> { ';' <NakedStatement> } ';'
  202.  
  203. <NestedFactor> :== '(' ( <CondExp> | <SELECTStatement> ) ')'
  204.  
  205. <NonJoinTableExp> :== <NonJoinTableTerm>
  206.  
  207. <NonJoinTablePrimary> :== ( <SELECTStatement> | '(' <NonJoinTableExp> ')' | "TABLE" '(' <FunctionCallStatement> ')' )
  208.  
  209. <NonJoinTableTerm> :== <NonJoinTablePrimary> { "INTERSECT" [ ( "ALL" | "DISTINCT" ) ] <NonJoinTablePrimary> }
  210.  
  211. <NullCallClause> :== ( "RETURNS" "NULL" "ON" "NULL" 'INPUT' | "CALLED" "ON" "NULL" 'INPUT' )
  212.  
  213. <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> )
  214.  
  215. <nxSQL> :== { ( <LogSwitch> | <TimeoutSwitch> | <CustomSwitch> | <VerboseSwitch> ) } [ <Statement> ] { ';' [ <Statement> ] } [ ';' ] <eof>
  216.  
  217. <OptionalDecimalSpec> :== [ '(' <integer_literal> :== <Digit> { <Digit> } ')' ]
  218.  
  219. <OptionalIgnoredSizeSpec> :== [ '(' <integer_literal> :== <Digit> { <Digit> } ')' ]
  220.  
  221. <OptionalPrecisionScaleSpec> :== [ '(' <integer_literal> :== <Digit> { <Digit> } [ ',' <integer_literal> :== <Digit> { <Digit> } ] ')' ]
  222.  
  223. <OptionalSizeSpec> :== [ '(' <integer_literal> :== <Digit> { <Digit> } ')' ]
  224.  
  225. <OrderColumn> :== <SqlName> [ '.' <SqlName> ]
  226.  
  227. <OrderItem> :== ( <OrderColumn> | <integer_literal> :== <Digit> { <Digit> } ) <SortingOptions>
  228.  
  229. <OrderList> :== <OrderItem> { ',' <OrderItem> }
  230.  
  231. <ParameterMode> :== [ ( "IN" | "OUT" | "INOUT" ) ]
  232.  
  233. <ParenthesizedSelectStatement> :== ( '(' <ParenthesizedSelectStatement> ')' | <SELECTStatement> )
  234.  
  235. <PasswordList> :== <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 { ','<character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 }
  236.  
  237. <PositiveFactor> :== ( <Literal> | <FieldRef> | <ScalarFunction> | <Aggregate_factor> | <NestedFactor> | '?' | ':' <SqlName> )
  238.  
  239. <PrimaryKeyConstraint> :== "PRIMARY" 'KEY' <ConstraintColumnList>
  240.  
  241. <ReferenceAction> :== ( 'CASCADE' | 'RESTRICT' | "SET" "NULL" | "SET" "DEFAULT" )
  242.  
  243. <Relation> :== <RelationalOperator> ( <ALL_or_ANY_clause> | <SimpleExpression> )
  244.  
  245. <RelationalOperator> :== ( '=' | '<=' | '<' | '>' | '>=' | '<>' | '%' | '%%' )
  246.  
  247. <RepeatStatement> :== "REPEAT" <NakedStatementBlock> "UNTIL" <CondExp> "END" "REPEAT"
  248.  
  249. <ReturnParenthesizedSelectStatement> :== ( '(' <ReturnParenthesizedSelectStatement> ')' | <TableExp1> )
  250.  
  251. <ReturnStatement> :== "RETURN" [ ( <CondExp> | <ReturnParenthesizedSelectStatement> ) ]
  252.  
  253. <RollbackTransactionStatement> :== "ROLLBACK" [ 'WORK' ]
  254.  
  255. <RoutineCharacteristic> :== ( <LanguageClause> | <DeterministicCharacteristic> | <SQLDataAccessIndication> | <NullCallClause> )
  256.  
  257. <RoutineCharacteristics> :== { <RoutineCharacteristic> }
  258.  
  259. <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> ] ')' )
  260.  
  261. <Selection> :== ( '*' | <CondExp> [ <ColumnAlias> ] )
  262.  
  263. <SelectionList> :== <Selection> { ',' <Selection> }
  264.  
  265. <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> ]
  266.  
  267. <SetPasswordsStatement> :== "SET" "PASSWORDS" [ [ ( 'ADD' | 'REMOVE' ) ] <PasswordList> ]
  268.  
  269. <SetStatement> :== "SET" <SqlName> [ '.' <SqlName> ] '=' ( "NULL" | "DEFAULT" | <CondExp> )
  270.  
  271. <SignedIntegerLiteral> :== [ '-' ] <integer_literal> :== <Digit> { <Digit> }
  272.  
  273. <SignedLiteral> :== ( <FloatLiteral> | <SignedIntegerLiteral> | <StringLiteral> | <DateLiteral> | <TimeLiteral> | <TimestampLiteral> | <IntervalLiteral> | <Boolean_literal> | <BLOBLiteral> | <GuidLiteral> | "NULL" )
  274.  
  275. <SimpleAlias> :== [ "AS" ] <SqlName>
  276.  
  277. <SimpleExpression> :== <Term> { ( '+' | '-' | '||' ) <Term> }
  278.  
  279. <SimpleExpressionList> :== <SimpleExpression> { ',' <SimpleExpression> }
  280.  
  281. <SimpleTableRef> :== ( <SqlName> [ '.' <SqlName> ] [ <SimpleAlias> ] | "TABLE" '(' <SqlName> '(' { <SimpleExpression> ',' } ')' ')' <SimpleAlias> )
  282.  
  283. <SimpleTableRefOrParenTableExp> :== ( <SimpleTableRef> | '(' <TableExp1> ')' [ <SimpleAlias> ] )
  284.  
  285. <SimpleWhenClause> :== "WHEN" <SimpleExpression> "THEN" ( "NULL" | <SimpleExpression> )
  286.  
  287. <SimpleWhenClauseList> :== <SimpleWhenClause> { <SimpleWhenClause> }
  288.  
  289. <SimplifySwitch> :== '#S' <Switch>
  290.  
  291. <SizeSpec> :== '(' <integer_literal> :== <Digit> { <Digit> } ')'
  292.  
  293. <SortingOptions> :== <CollationOptions> { "IGNORE" "CASE" } [ ( 'ASC' | 'DESC' ) ] [ ( 'NULLS' ( 'FIRST' | 'LAST' | 'ONLY' ) | "NO" 'NULLS' ) ]
  294.  
  295. <SpecialDataType> :== ( "RECREV" | "GUID" )
  296.  
  297. <SQLDataAccessIndication> :== ( "NO" "SQL" | "CONTAINS" "SQL" | "READS" "SQL" 'DATA' | "MODIFIES" "SQL" 'DATA' )
  298.  
  299. <SqlName> :== ( <identifier> :== ( <Letter> | '@' ) { <Letter> | <Digit> | '@' } | <quoted_name> :== '"' { <identChars> } '"' | <quoted_temp_name> :== '"' '<' { <identChars> } '>' '"' )
  300.  
  301. <Statement> :== { ( <BlobSwitch> | <IndexSwitch> | <SimplifySwitch> ) } <NakedStatement>
  302.  
  303. <StatementBlock> :== "BEGIN" [ [ "NOT" ] "ATOMIC" ] <NakedStatementBlock> "END"
  304.  
  305. <StatementOrStatementBlock> :== ( <StatementBlock> | <NakedStatementAsBlock> )
  306.  
  307. <StringDataType> :== ( <AnsiStringDataType> | <UnicodeStringDataType> ) [ ( "COLLATE" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 | "LOCALE" <integer_literal> :== <Digit> { <Digit> } ) <CompareFlags> ]
  308.  
  309. <StringLiteral> :== [ 'N' ] <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 { [ 'N' ] <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39 }
  310.  
  311. <Switch> :== ( '+' | '-' )
  312.  
  313. <TableConstraint> :== [ "CONSTRAINT" <SqlName> ] ( <PrimaryKeyConstraint> | <UniqueKeyConstraint> | <ForeignKeyConstraint> | <CheckConstraint> )
  314.  
  315. <TableConstructor> :== "VALUES" '(' <ValueList> ')' { ',''(' <ValueList> ')' }
  316.  
  317. <TableExp1> :== ( <SimpleTableRefOrParenTableExp> <JoinTableExp> { <JoinTableExp> } [ <SimpleAlias> ] | <NonJoinTableExp> | '(' <TableExp1> ')' [ <SimpleAlias> ] ) { ( "UNION" | "EXCEPT" ) [ ( "ALL" | "DISTINCT" ) ] <NonJoinTableTerm> }
  318.  
  319. <TableExp2> :== ( <SimpleTableRefOrParenTableExp> <JoinTableExp> { <JoinTableExp> } [ <SimpleAlias> ] | '(' <TableExp1> ')' [ <SimpleAlias> ] )
  320.  
  321. <TableRef> :== ( <TableExp2> | <SimpleTableRef> ) [ '(' <ColumnNameList> ')' ]
  322.  
  323. <TableRefList> :== <TableRef> { ',' <TableRef> }
  324.  
  325. <Term> :== <Factor> { ( '*' | '/' ) <Factor> }
  326.  
  327. <ThrowStatement> :== "SIGNAL" <SimpleExpression>
  328.  
  329. <TimeLiteral> :== "TIME" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
  330.  
  331. <TimeoutSwitch> :== '#T' <integer_literal> :== <Digit> { <Digit> }
  332.  
  333. <TimestampLiteral> :== "TIMESTAMP" <character_string_literal> :== #39 { <noQuote> | #39 #39 } #39
  334.  
  335. <TryStatement> :== "TRY" <NakedStatementBlock> "CATCH" <CondExp> [ <NakedStatementBlock> ] { "CATCH" <CondExp> [ <NakedStatementBlock> ] } "END"
  336.  
  337. <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 ]
  338.  
  339. <UnicodeStringDataType> :== ( ( "NCHAR" [ "VARYING" ] | "NVARCHAR" | "NATIONAL" ( "CHARACTER" | "CHAR" ) [ "VARYING" ] ) <OptionalSizeSpec> | "NTEXT" <OptionalIgnoredSizeSpec> | "NATIONAL" "CHARACTER" "LARGE" 'OBJECT' <OptionalIgnoredSizeSpec> | "NCHAR" "LARGE" 'OBJECT' <OptionalIgnoredSizeSpec> | "NCLOB" <OptionalIgnoredSizeSpec> | "NSINGLECHAR" )
  340.  
  341. <UniqueClause> :== "UNIQUE" '(' <TableExp1> ')'
  342.  
  343. <UniqueKeyConstraint> :== "UNIQUE" <ConstraintColumnList>
  344.  
  345. <UpdateItem> :== <SqlName> [ '.' <SqlName> ] '=' ( "NULL" | <SimpleExpression> | "DEFAULT" )
  346.  
  347. <UpdateList> :== <UpdateItem> { ',' <UpdateItem> }
  348.  
  349. <UpdateStatement> :== "UPDATE" <SimpleTableRef> "SET" <UpdateList> [ "WHERE" <CondExp> ]
  350.  
  351. <UsingItem> :== <SqlName>
  352.  
  353. <UsingList> :== <UsingItem> { ',' <UsingItem> }
  354.  
  355. <ValueItem> :== ( "DEFAULT" | "NULL" | <SimpleExpression> )
  356.  
  357. <ValueList> :== <ValueItem> { ',' <ValueItem> }
  358.  
  359. <VerboseSwitch> :== '#V' <Switch>
  360.  
  361. <WhenClause> :== "WHEN" <CondExp> "THEN" ( "NULL" | <SimpleExpression> )
  362.  
  363. <WhenClauseList> :== <WhenClause> { <WhenClause> }
  364.  
  365. <WhileStatement> :== "WHILE" <CondExp> "DO" <NakedStatementBlock> "END" "WHILE"
  366.  
  367. <YMDHMS> :== ( "YEAR" | "MONTH" | "DAY" | "HOUR" | "MINUTE" | "SECOND" )
  368.  
  369.  
Home | Site Contents | Documentation | FAQ, Tips & Tricks | NexusDB FAQ | SQL