/* * Statement */
| Statement | ::= | StatementPart <EOF> |
/**
* Parse a search condition.
*
* @param sqlFragment a fragment of an SQL statement, representing a
* search condition
* @return a {@code ValueNode} representing the search condition
*/
| SearchCondition | ::= | valueExpression <EOF> |
| proceduralStatement | ::= | ( insertStatement | preparableUpdateStatement | preparableDeleteStatement | preparableSelectStatement | mergeStatement | callStatement ) |
/* * StatementPart * * @param tokenHolder returns the token that starts * the statement. If null, ignored. */
| StatementPart | ::= | ( spsRenameStatement | lockStatement ) |
| | | ( createStatements | dropStatements | spsAlterStatement | globalTemporaryTableDeclaration | preparableSQLDataStatement | spsSetStatement | truncateTableStatement | grantStatement | revokeStatement | execStatement ) |
/* * spsCreateStatement */
| createStatements | ::= | <CREATE> ( ( schemaDefinition | viewDefinition | triggerDefinition | synonymDefinition | roleDefinition | sequenceDefinition ) | tableDefinition | procedureDefinition | functionDefinition | aggregateDefinition | udtDefinition | indexDefinition ) |
/* * spsDropStatement */
| dropStatements | ::= | <DROP> ( dropSchemaStatement | dropTableStatement | dropIndexStatement | dropAliasStatement | dropViewStatement | dropTriggerStatement | dropRoleStatement | dropSequenceStatement ) |
/* * spsAlterStatement */
| spsAlterStatement | ::= | <ALTER> ( alterTableStatement ) |
/* * spsSetStatement */
| spsSetStatement | ::= | <SET> ( setIsolationStatement | setSchemaStatement | setMessageLocaleStatement | setRoleStatement | setConstraintsStatement ) |
| | | <SET> ( setSchemaStatement | setIsolationStatement ) |
/** * constraintsReference */
| constraintsReference | ::= | qualifiedName |
/** * setConstraintsStatement */
| setConstraintsStatement | ::= | <CONSTRAINTS> ( constraintsReference ( <COMMA> constraintsReference )* | <ALL> ) ( <DEFERRED> | <IMMEDIATE> ) |
/* * preparableSQLDataStatement * * preparableSQLDataStatement differs from * directSQLDataStatement in that it * supports positioned update and delete * and a preparable select (with FOR UPDATE) * instead of a direct select (without FOR UPDATE) */
| preparableSQLDataStatement | ::= | preparableDeleteStatement |
| | | preparableSelectStatement | |
| | | insertStatement | |
| | | mergeStatement | |
| | | preparableUpdateStatement | |
| | | callStatement | |
| | | savepointStatement |
/* * preparableDeleteStatement * * This may be a search or positioned delete statement. */
| preparableDeleteStatement | ::= | <DELETE> deleteBody |
| deleteBody | ::= | <FROM> newInvocation ( <WHERE> whereClause )? |
| | | <FROM> qualifiedName ( ( <AS> )? identifier )? ( propertyList <CHECK_PROPERTIES> )? ( <WHERE> ( currentOfClause | whereClause ) )? |
/* * currentOfClause */
| currentOfClause | ::= | <CURRENT> <OF> identifier |
/* * preparableSelectStatement * * * The preparable select statement is a superset of * the directSelectStatementMultipleRows in that it * allows both the preparable single row select statement * (a query expression that returns one row, although it * is also handled like a cursor) and the preparable * multiple row select statement, which allows not only * an order by clause but also a for update clause. */
| preparableSelectStatement | ::= | queryExpression ( orderByClause )? offsetFetchFirstClause ( <FOR> forUpdateClause )? ( atIsolationLevel )? |
/* * insertStatement */
| insertStatement | ::= | <INSERT> <INTO> targetTable insertColumnsAndSource |
| targetTable | ::= | newInvocation |
| | | qualifiedName |
/* * preparableUpdateStatement */
| preparableUpdateStatement | ::= | <UPDATE> updateBody |
| tableOrIndex | ::= | <TABLE> |
| | | <INDEX> |
| updateBody | ::= | newInvocation <SET> setClauseList ( <WHERE> whereClause )? |
| | | qualifiedName ( ( <AS> )? identifier )? ( propertyList <CHECK_PROPERTIES> )? <SET> setClauseList ( <WHERE> ( whereClause | currentOfClause ) )? |
/* * callStatement */
| callStatement | ::= | ( bareCallStatement | <LEFT_BRACE> bareCallStatement <RIGHT_BRACE> ) |
/* * baseCallStatement */
| bareCallStatement | ::= | <CALL> primaryExpression |
| | | dynamicParameterSpecification <EQUALS_OPERATOR> <CALL> rowValueConstructor |
/* * mergeStatement */
| mergeStatement | ::= | <MERGE> <INTO> tableFactor <USING> tableFactor joinCondition matchingClauseList |
/* * matchingClauseList */
| matchingClauseList | ::= | matchingClause ( matchingClause )* |
/* * matchingClause */
| matchingClause | ::= | <WHEN> <MATCHED> ( <AND> valueExpression )? <THEN> ( <DELETE> | <UPDATE> <SET> setClauseList ) |
| | | <WHEN> <NOT> <MATCHED> ( <AND> valueExpression )? <THEN> <INSERT> ( <LEFT_PAREN> insertColumnList <RIGHT_PAREN> )? <VALUES> <LEFT_PAREN> rowValueConstructorList <RIGHT_PAREN> |
/* * primaryExpression */
| primaryExpression | ::= | routineInvocation |
| | | primaryExpressionXX |
/* * savepointStatement savepointStatementClauses contains the UNIQUE, ON ROLLBACK RETAIN LOCKS, ON ROLLBACK RETAIN CURSORS clauses. 0 - Boolean - UNIQUE clause 1 - Boolean - ON ROLLBACK RETAIN LOCKS clause 2 - Boolean - ON ROLLBACK RETAIN CURSORS clause */
| savepointStatement | ::= | ( <SAVEPOINT> identifier ( savepointStatementClause )+ | <ROLLBACK> ( <WORK> )? <TO> <SAVEPOINT> ( identifier )? | <RELEASE> ( <TO> )? <SAVEPOINT> identifier ) |
| savepointStatementClause | ::= | ( <UNIQUE> | <ON> <ROLLBACK> <RETAIN> ( LocksOrCursors ) ) |
/* * LocksOrCursors */
| LocksOrCursors | ::= | <LOCKS> |
| | | <CURSORS> |
/* * globalTemporaryTableDeclaration declareTableClauses contains the NOT LOGGED, on commit and on rollback clauses. 0 - Boolean - NOT LOGGED clause 1 - Boolean - on commit behavior 2 - Boolean - on rollback behavior */
| globalTemporaryTableDeclaration | ::= | <DECLARE> <GLOBAL> <TEMPORARY> <TABLE> qualifiedName tableElementList ( declareTableClause )+ |
| declareTableClause | ::= | ( <NOT> <LOGGED> | <ON> <COMMIT> ( onCommit ) <ROWS> | <ON> <ROLLBACK> <DELETE> <ROWS> ) |
/* * onCommit */
| onCommit | ::= | <PRESERVE> |
| | | <DELETE> |
/* * tableElementList */
| tableElementList | ::= | <LEFT_PAREN> tableElement ( <COMMA> tableElement )* <RIGHT_PAREN> |
/* * tableElement */
| tableElement | ::= | columnDefinition |
| | | tableConstraintDefinition |
/* * columnDefinition */
| columnDefinition | ::= | identifier ( ( dataTypeDDL ) )? ( defaultAndConstraints )? |
/* * defaultAndConstraints */
| defaultAndConstraints | ::= | columnConstraintDefinition ( columnConstraintDefinition )* ( defaultClause ( columnConstraintDefinition )* )? |
| | | defaultClause ( columnConstraintDefinition )* |
/* * dataTypeDDL */
| dataTypeDDL | ::= | dataTypeCommon |
| | | javaType |
/** Returns a dataTypeDDL() as a catalog type, ie. the Java interface TypeDescriptor. */
| catalogType | ::= | dataTypeDDL |
/* * dataTypeCast */
| dataTypeCast | ::= | dataTypeCommon |
| | | javaType |
/* * dataTypeCommon */
| dataTypeCommon | ::= | ( ( characterStringType ) | ( nationalCharacterStringType ) | numericType | datetimeType | <BOOLEAN> | longType | LOBType | XMLType ) |
/* * characterStringType */
| characterStringType | ::= | ( ( <VARCHAR> charLength ) | charOrCharacter ( <VARYING> charLength | ( charLength )? ) ) ( forBitData )? |
/* * charOrCharacter */
| charOrCharacter | ::= | <CHAR> |
| | | <CHARACTER> |
/* * charType */
| charLength | ::= | <LEFT_PAREN> length <RIGHT_PAREN> |
/* ** forBitData */
| forBitData | ::= | <FOR> <BIT> <DATA> |
/* * nationalCharacterStringType */
| nationalCharacterStringType | ::= | ( <NATIONAL> charOrCharacter ( <VARYING> charLength | ( charLength )? ) | <NCHAR> ( <VARYING> charLength | ( charLength )? ) | <NVARCHAR> ( charLength ) ) |
/* * lobType */
| LOBType | ::= | ( <BLOB> ( lengthAndModifier )? | <CLOB> ( lengthAndModifier )? | <NCLOB> lengthAndModifier | <BINARY> <LARGE> <OBJECT> ( lengthAndModifier )? | charOrCharacter <LARGE> <OBJECT> ( lengthAndModifier )? | <NATIONAL> <CHARACTER> <LARGE> <OBJECT> lengthAndModifier ) |
/* * numericType */
| numericType | ::= | exactNumericType |
| | | approximateNumericType |
/* * exactNumericType */
| exactNumericType | ::= | ( <NUMERIC> | <DECIMAL> | <DEC> ) ( <LEFT_PAREN> precision ( <COMMA> scale )? <RIGHT_PAREN> )? |
| | | exactIntegerType |
/* * exactNumericType */
| exactIntegerType | ::= | ( <INTEGER> | <INT> ) |
| | | <SMALLINT> | |
| | | <BIGINT> |
/* * approximateNumericType */
| approximateNumericType | ::= | <FLOAT> ( <LEFT_PAREN> precision <RIGHT_PAREN> )? |
| | | <REAL> | |
| | | doubleType |
/* * doubleType */
| doubleType | ::= | ( <DOUBLE> <PRECISION> | <DOUBLE> ) |
/* * longType */
| longType | ::= | <LONG> longSubType |
| longSubType | ::= | <VARCHAR> ( forBitData )? |
| | | <NVARCHAR> |
/* * XMLType */
| XMLType | ::= | <XML> |
/* * xmlDocOrContent * * Parse the XML keywords DOCUMENT and CONTENT. We don't * support CONTENT yet, so we throw an appropriate error * if we see it. * */
| xmlDocOrContent | ::= | |
| | | <CONTENT> | |
| | | <DOCUMENT> |
/* * javaType */
| javaType | ::= | qualifiedName |
/* * javaDSL * * A Java dot-separated list. */
| javaDSL | ::= | caseSensitiveIdentifierPlusReservedWords ( javaDSLNameExtender )* |
/* * javaClassName */
| javaClassName | ::= | javaDSL |
/* * javaDSLNameExtender */
| javaDSLNameExtender | ::= | <PERIOD> caseSensitiveIdentifierPlusReservedWords |
/* * lengthAndModifier */
| lengthAndModifier | ::= | <LEFT_PAREN> ( <LENGTH_MODIFIER> | <EXACT_NUMERIC> ( <IDENTIFIER> )? ) <RIGHT_PAREN> |
/* * length */
| length | ::= | <EXACT_NUMERIC> |
/* * exactNumber */
| exactNumber | ::= | ( sign )? <EXACT_NUMERIC> |
/* * precision */
| precision | ::= | uint_value |
/* * uint_value */
| uint_value | ::= | <EXACT_NUMERIC> |
/* * scale */
| scale | ::= | uint_value |
/* * datetimeType */
| datetimeType | ::= | <DATE> |
| | | <TIME> | |
| | | <TIMESTAMP> |
/* * qualifiedName */
| qualifiedName | ::= | identifier ( <PERIOD> identifier )? |
/* * queryExpression * * We have to be carefull to get the associativity correct. According to the SQL spec *::= * * | UNION [ ALL ] * | EXCEPT [ ALL ] * Meaning that * t1 UNION ALL t2 UNION t3 * is equivalent to * (t1 UNION ALL t2) UNION t3 * However recursive descent parsers want recursion to be on the right, so this kind of associativity is unnatural * for our parser. The queryExpression method must know whether it is being called as the right hand side of a * set operator to produce a query tree with the correct associativity. */
| queryExpression | ::= | nonJoinQueryTerm ( unionOrExcept )? |
/* * unionOrExcept */
| unionOrExcept | ::= | <UNION> ( <ALL> | <DISTINCT> )? queryExpression |
| | | <EXCEPT> ( <ALL> | <DISTINCT> )? queryExpression |
/* * nonJoinQueryTerm * * Be careful with the associativity of INTERSECT. According to the SQL spec * t1 INTERSECT t2 INTERSECT ALL t3 * is equivalent to * (t1 INTERSECT t2) INTERSECT ALL t3 * which is not the same as * t1 INTERSECT (t2 INTERSECT ALL t3) * See the comment on queryExpression. */
| nonJoinQueryTerm | ::= | nonJoinQueryPrimary ( intersect )? |
/* * intersect */
| intersect | ::= | <INTERSECT> ( <ALL> | <DISTINCT> )? nonJoinQueryTerm |
/* * nonJoinQueryPrimary */
| nonJoinQueryPrimary | ::= | simpleTable |
| | | <LEFT_PAREN> queryExpression ( orderByClause )? offsetFetchFirstClause <RIGHT_PAREN> |
/* * simpleTable */
| simpleTable | ::= | querySpecification |
| | | tableValueConstructor |
/* * querySpecification */
| querySpecification | ::= | <SELECT> ( setQuantifier )? selectList tableExpression |
/* * setQuantifier */
| setQuantifier | ::= | <DISTINCT> |
| | | <ALL> |
/* * selectList */
| selectList | ::= | <ASTERISK> |
| | | selectColumnList |
| selectColumnList | ::= | selectSublist ( <COMMA> selectSublist )* |
/* * selectSublist */
| selectSublist | ::= | qualifiedName <PERIOD> <ASTERISK> |
| | | derivedColumn |
/* * derivedColumn */
| derivedColumn | ::= | valueExpression ( asClause )? |
/* * asClause */
| asClause | ::= | ( <AS> )? identifier |
/* * valueExpression */
| valueExpression | ::= | orExpression ( <OR> orExpression )* |
/* * orExpression */
| orExpression | ::= | andExpression ( <AND> andExpression )* |
/* * andExpression */
| andExpression | ::= | ( <NOT> )? isSearchCondition |
/* * isSearchCondition */
| isSearchCondition | ::= | booleanPrimary |
/* * booleanPrimary */
| booleanPrimary | ::= | predicate |
/* * predicate */
| predicate | ::= | ( additiveExpression | existsExpression ) ( remainingPredicate )* |
/* * remainingPredicates */
| remainingPredicate | ::= | remainingNonNegatablePredicate |
| | | ( <NOT> )? remainingNegatablePredicate |
/* * remainingNonNegatablePredicate */
| remainingNonNegatablePredicate | ::= | compOp ( ( quantifier <LEFT_PAREN> tableSubquery <RIGHT_PAREN> ) | ( additiveExpression ) ) |
/* * remainingNegatablePredicate */
| remainingNegatablePredicate | ::= | <IN> inPredicateValue |
| | | <IS> ( <NOT> )? <NULL> | |
| | | <LIKE> additiveExpression ( <ESCAPE> additiveExpression | <LEFT_BRACE> <ESCAPE> additiveExpression <RIGHT_BRACE> )? | |
| | | <BETWEEN> additiveExpression <AND> additiveExpression |
/* * compOp */
| compOp | ::= | <EQUALS_OPERATOR> |
| | | <NOT_EQUALS_OPERATOR> | |
| | | <NOT_EQUALS_OPERATOR2> | |
| | | <LESS_THAN_OPERATOR> | |
| | | <GREATER_THAN_OPERATOR> | |
| | | <LESS_THAN_OR_EQUALS_OPERATOR> | |
| | | <GREATER_THAN_OR_EQUALS_OPERATOR> |
/* * additiveExpression */
| additiveExpression | ::= | multiplicativeExpression ( additiveOperator multiplicativeExpression )* |
/* * additiveOperator */
| additiveOperator | ::= | <PLUS_SIGN> |
| | | <MINUS_SIGN> |
/* * multiplicativeExpression */
| multiplicativeExpression | ::= | unaryExpression ( multiplicativeOperator unaryExpression )* |
/* * multiplicativeOperator */
| multiplicativeOperator | ::= | <ASTERISK> |
| | | <SOLIDUS> | |
| | | <CONCATENATION_OPERATOR> |
/* * unaryExpression */
| unaryExpression | ::= | ( sign )? primaryExpression |
/* * sign */
| sign | ::= | <PLUS_SIGN> |
| | | <MINUS_SIGN> |
/* * primaryExpressionXX */
| primaryExpressionXX | ::= | primary ( nonStaticMethodCallOrFieldAccess )* |
| nonStaticMethodCallOrFieldAccess | ::= | nonStaticMethodInvocation |
/* * nonStaticMethodInvocation */
| nonStaticMethodInvocation | ::= | ( <FIELD_REFERENCE> | <PERIOD> ) methodName methodCallParameterList |
| | | <PERIOD> methodName |
/* * methodName */
| methodName | ::= | caseSensitiveIdentifierPlusReservedWords |
/* * staticMethodName */
| staticMethodName | ::= | caseSensitiveIdentifierPlusReservedWords |
/* * methodParameter */
| methodParameter | ::= | valueExpression |
| | | nullSpecification |
/* * primary */
| primary | ::= | staticClassReference |
| | | valueExpressionPrimary |
/* * staticClassReference */
| staticClassReference | ::= | javaClass <DOUBLE_COLON> staticClassReferenceType |
/* * staticClassReferenceType */
| staticClassReferenceType | ::= | staticMethodInvocation |
| | | staticClassFieldReference |
/* * staticClassFieldReference */
| staticClassFieldReference | ::= | caseSensitiveIdentifierPlusReservedWords |
/* * nonSecondDatetimeField */
| nonSecondDatetimeField | ::= | <YEAR> |
| | | <MONTH> | |
| | | <DAY> | |
| | | <HOUR> | |
| | | <MINUTE> |
| escapedValueFunction | ::= | miscBuiltinsCore |
| | | <SUBSTRING> <LEFT_PAREN> additiveExpression <COMMA> additiveExpression ( <COMMA> additiveExpression )? <RIGHT_PAREN> | |
| | | <CURDATE> <LEFT_PAREN> <RIGHT_PAREN> | |
| | | <CURTIME> <LEFT_PAREN> <RIGHT_PAREN> | |
| | | <CONCAT> <LEFT_PAREN> additiveExpression <COMMA> additiveExpression <RIGHT_PAREN> | |
| | | userNode <LEFT_PAREN> <RIGHT_PAREN> | |
| | | timestampArithmeticFuncion | |
| | | escapedSYSFUNFunction |
/* * numericValueFunction */
| escapedSYSFUNFunction | ::= | <IDENTIFIER> methodCallParameterList |
/* * timestampArithmeticFuncion */
| timestampArithmeticFuncion | ::= | <TIMESTAMPADD> <LEFT_PAREN> jdbcIntervalType <COMMA> additiveExpression <COMMA> additiveExpression <RIGHT_PAREN> |
| | | <TIMESTAMPDIFF> <LEFT_PAREN> jdbcIntervalType <COMMA> additiveExpression <COMMA> additiveExpression <RIGHT_PAREN> |
/* * jdbcIntervalType */
| jdbcIntervalType | ::= | <SQL_TSI_FRAC_SECOND> |
| | | <SQL_TSI_SECOND> | |
| | | <SQL_TSI_MINUTE> | |
| | | <SQL_TSI_HOUR> | |
| | | <SQL_TSI_DAY> | |
| | | <SQL_TSI_WEEK> | |
| | | <SQL_TSI_MONTH> | |
| | | <SQL_TSI_QUARTER> | |
| | | <SQL_TSI_YEAR> |
/* * numericValueFunction */
| numericValueFunction | ::= | <ABS> absFunction |
| | | <ABSVAL> absFunction | |
| | | <SQRT> <LEFT_PAREN> additiveExpression <RIGHT_PAREN> | |
| | | <MOD> modFunction | |
| | | <IDENTITY_VAL_LOCAL> <LEFT_PAREN> <RIGHT_PAREN> |
/* * coalesceFunction */
| coalesceFunction | ::= | <LEFT_PAREN> coalesceExpression ( <COMMA> coalesceExpression )* <RIGHT_PAREN> |
/* * coalesceExpression */
| coalesceExpression | ::= | additiveExpression |
/* * absFunction */
| absFunction | ::= | <LEFT_PAREN> additiveExpression <RIGHT_PAREN> |
/* * modFunction */
| modFunction | ::= | <LEFT_PAREN> additiveExpression <COMMA> additiveExpression <RIGHT_PAREN> |
/* * datetimeField */
| datetimeField | ::= | nonSecondDatetimeField |
| | | <SECOND> |
| characterValueFunction | ::= | <SUBSTR> <LEFT_PAREN> additiveExpression <COMMA> additiveExpression ( <COMMA> additiveExpression )? <RIGHT_PAREN> |
| | | ( <UPPER> | <LOWER> ) <LEFT_PAREN> additiveExpression <RIGHT_PAREN> | |
| | | ( <UCASE> | <LCASE> ) <LEFT_PAREN> additiveExpression <RIGHT_PAREN> | |
| | | trimFunction | |
| | | <LOCATE> <LEFT_PAREN> additiveExpression <COMMA> additiveExpression ( <COMMA> additiveExpression )? <RIGHT_PAREN> |
| trimFunction | ::= | trimType <LEFT_PAREN> additiveExpression <RIGHT_PAREN> |
| | | <TRIM> ansiTrim |
| ansiTrim | ::= | <LEFT_PAREN> ansiTrimSpec ( <FROM> additiveExpression <RIGHT_PAREN> | additiveExpression <FROM> additiveExpression <RIGHT_PAREN> ) |
| | | <LEFT_PAREN> additiveExpression ( <FROM> additiveExpression <RIGHT_PAREN> | <RIGHT_PAREN> ) |
| ansiTrimSpec | ::= | <TRAILING> |
| | | <LEADING> | |
| | | <BOTH> |
| trimType | ::= | <RTRIM> |
| | | <LTRIM> |
/* * valueExpressionPrimary */
| valueExpressionPrimary | ::= | <LEFT_BRACE> <FN> escapedValueFunction <RIGHT_BRACE> |
| | | <CURRENT> ( <SCHEMA> | <SQLID> ) | |
| | | <CURRENT> <ISOLATION> | |
| | | valueSpecification | |
| | | newInvocation | |
| | | windowOrAggregateFunctionNode | |
| | | miscBuiltins | |
| | | columnReference | |
| | | <LEFT_PAREN> ( subquery | valueExpression ) <RIGHT_PAREN> | |
| | | castSpecification | |
| | | nextValueExpression |
/* * miscBuiltins */
| miscBuiltins | ::= | miscBuiltinsCore |
| | | datetimeValueFunction | |
| | | routineInvocation |
| miscBuiltinsCore | ::= | <GET_CURRENT_CONNECTION> <LEFT_PAREN> <RIGHT_PAREN> |
| | | numericValueFunction | |
| | | characterValueFunction | |
| | | dataTypeScalarFunction | |
| | | <COALESCE> coalesceFunction | |
| | | <VALUE> coalesceFunction | |
| | | <LENGTH> <LEFT_PAREN> additiveExpression <RIGHT_PAREN> | |
| | | xmlFunction |
/* * dataTypeScalarFunction */
| dataTypeScalarFunction | ::= | dateTimeScalarFunction |
| | | numericFunctionType <LEFT_PAREN> additiveExpression <RIGHT_PAREN> | |
| | | charOrVarchar <LEFT_PAREN> additiveExpression ( <COMMA> length )? <RIGHT_PAREN> |
/* * xmlFunction * * This method parses the built-in functions used with * the XML datatype. * */
| xmlFunction | ::= | <XMLPARSE> <LEFT_PAREN> xmlDocOrContent xmlParseValue <RIGHT_PAREN> |
| | | <XMLSERIALIZE> <LEFT_PAREN> xmlSerializeValue <RIGHT_PAREN> | |
| | | <XMLEXISTS> <LEFT_PAREN> xmlQueryValue <RIGHT_PAREN> | |
| | | <XMLQUERY> <LEFT_PAREN> xmlQueryValue <RIGHT_PAREN> |
/* * xmlParseValue * * Syntax is as follows: * * XMLPARSE( DOCUMENTPRESERVE WHITESPACE ) * * The result of this operation will be an XML value, which can either * be used transiently or else can be stored persistently in a table that * has an XML column. For example: * * ij> CREATE TABLE x_table (id INT, xdoc XML); * 0 rows inserted/updated/deleted * ij> INSERT INTO x_table VALUES (1, XMLPARSE(DOCUMENT ' doc ' * PRESERVE WHITESPACE)); * 1 row inserted/updated/deleted * * We only allow XML documents (as opposed to XML content) to be * parsed into XML values. Note that we require the "PRESERVE WHITESPACE" * keyword to be explicit; this is because the SQL/XML (2003) spec says that * if no whitespace option is given, the default is "STRIP WHITESPACE", which * we don't support (yet). * * By the time we get to this method, the "DOCUMENT" keyword has already * been parsed. * */
| xmlParseValue | ::= | additiveExpression xmlPreserveWhitespace |
/* * xmlPreserveWhitespace * * For now, we only support the PRESERVE WHITESPACE option. * */
| xmlPreserveWhitespace | ::= | |
| | | <STRIP> <WHITESPACE> | |
| | | <PRESERVE> <WHITESPACE> |
/* * xmlSerializeValue * * Syntax is as follows: * * XMLSERIALIZE(AS ) * * The result of this operation will be a string value with the type specified * by the user. For example: * * ij> SELECT id, XMLSERIALIZE(xdoc AS varchar(30)) FROM x_table; * ID |2 * ------------------------------------------ * 1 | doc * */
| xmlSerializeValue | ::= | additiveExpression xmlSerializeTargetType |
/* * xmlSerializeTargetType * * Parse the target type of an XMLSERIALIZE operation. * */
| xmlSerializeTargetType | ::= | |
| | | <AS> dataTypeDDL |
/* * xmlQueryValue * * This method is used for parsing the XMLEXISTS and XMLQUERY operators * (which operator depends on the received boolean parameter). * * For XMLEXISTS, the syntax is as follows: * * XMLEXISTS(PASSING BY REF ) * * The result of this operation will be a boolean true/false/unknown value: * -- Unknown if either or is null; * -- True if evaluation of the given query expression against the * given xml-value returns at least one node. * -- False otherwise. * * For example: * * ij> SELECT id FROM x_table WHERE XMLEXISTS('/simple' PASSING BY REF xdoc); * ID * ----------- * 1 * * ==== * * For XMLQUERY, the syntax is as follows: * * XMLQUERY( * PASSING BY REF * [ RETURNING SEQUENCE [ BY REF ] ] * EMPTY ON EMPTY * ) * * The result of this operation will be an XMLDataValue. * * For example: * * ij> SELECT XMLSERIALIZE( * XMLQUERY('/simple' PASSING BY REF xdoc EMPTY ON EMPTY) AS CHAR(100)); * ID * ----------- * doc * */
| xmlQueryValue | ::= | additiveExpression <PASSING> xmlPassingMechanism xqVarList ( ( xqReturningClause ( xmlPassingMechanism )? )? xqEmptyHandlingClause | ) |
/** * xqVarList * * Parse a list of XML query variables, which can include at most one * XML value to be used as the "context item" for the query. If * such a context item was found, return that item; for all other * variable declarations we currently throw a "not supported" error * because Xalan doesn't allowing binding of variables. */
| xqVarList | ::= | xqVariable ( <COMMA> xqVariable )* |
/** * xqVariable * * Parse an XML query variable. If the argument is an XML value * to be used as the "context item" for a query, then store the * value in the first slot of the received ValueNode array; * otherwise, throw a "not supported" errror (for now). */
| xqVariable | ::= | additiveExpression ( <AS> identifier )? ( ( xmlPassingMechanism )? ) |
/* * xmlPassingMechanism * * For now, we only support the BY REF option because * that gives us better performance (allows us to avoid * performing potentially deep copies of XML nodes). This * means that if the same XML value is passed BY REF into * two different XML arguments for a single operator, then * every node in the first XML argument must have an * identical node in the second XML argument, and the * ids for both nodes must be the same. That said, * since we don't support variable binding yet, this * becomes a non-issue because we can't pass XML values. * In the future, though, we may choose to support the * passing/binding of variables (the only reason we * don't now is because Xalan doesn't support it) and * if we do, BY REF should provide better performance * due to lack of deep copying. */
| xmlPassingMechanism | ::= | <BY> <REF> |
| | | <BY> <VALUE> |
/* * xqReturningClause * * For now we only support "RETURNING SEQUENCE". The reason * is that this applies to the XMLQUERY operator and the * results of evaluating a query expression in Xalan against * an XML value can be an arbritary sequence of items--including * atomic values. For simplicity we just return the values * as they are, without doing any further work. SQL/XML[2006] * says that if we supported RETURNING CONTENT then we'd have * to construct an XQuery document from the results--but we don't * do that extra work for now, so we just say that we return * SEQUENCE. * * NOTE: This means that we may not be able to store the results * of an XMLQUERY operation into a Derby XML column. Right now * an XML column can only hold valid DOCUMENT nodes, which we * we define as an XML value whose serialized form can be parsed * by a JAXP DocumentBuilder (because that's what Derby's XMLPARSE * operator uses and the result is always a Document node). * Internally this means that we can only store a sequence if it * contains exactly one org.w3c.dom.Node that is an instance of * org.w3c.dom.Document. If the result of an XMLQUERY operation * does not fit this criteria then it will *not* be storable into * Derby XML columns. */
| xqReturningClause | ::= | <RETURNING> <SEQUENCE> |
| | | <RETURNING> <CONTENT> |
/* * xqEmptyHandlingClause * * Defines what the behavior should be when an XMLQUERY operator * results in an empty sequence. For now we just return the * empty sequence. */
| xqEmptyHandlingClause | ::= | <EMPTY> <ON> <EMPTY> |
| | | <NULL> <ON> <EMPTY> |
/* * numericFunctionType */
| numericFunctionType | ::= | doubleType |
| | | exactIntegerType |
/* * dateTimeScalarFunction */
| dateTimeScalarFunction | ::= | <TIME> <LEFT_PAREN> additiveExpression <RIGHT_PAREN> |
| | | <DATE> <LEFT_PAREN> additiveExpression <RIGHT_PAREN> | |
| | | <TIMESTAMP> <LEFT_PAREN> additiveExpression timestampFunctionCompletion | |
| | | datetimeField <LEFT_PAREN> additiveExpression <RIGHT_PAREN> |
/* * timestampFunctionCompletion */
| timestampFunctionCompletion | ::= | <RIGHT_PAREN> |
| | | <COMMA> additiveExpression <RIGHT_PAREN> |
/* * booleanLiteral */
| booleanLiteral | ::= | <TRUE> |
| | | <FALSE> |
/* * generalValueSpecification */
| generalValueSpecification | ::= | dynamicParameterSpecification |
| | | userNode | |
| | | currentRoleNode |
| userNode | ::= | <USER> |
| | | <CURRENT_USER> | |
| | | <SESSION_USER> |
/* * currentRoleNode */
| currentRoleNode | ::= | <CURRENT_ROLE> |
/* * newInvocation */
| newInvocation | ::= | <NEW> javaClassName methodCallParameterList |
/* * vtiTableConstruct * * Parse a TABLE() constructor that corresponds to an internal * VTI invocation. For example: * * TABLE ((arg1, arg2, ...) ) * * where is a table name that Derby will map internally * to a VTI (ex. "SYSCS_DIAG.SPACE_TABLE"). The list of arguments * will then be passed to the VTI when it is invoked (DERBY-2152). * * An example query where this might occur is as follows: * * SELECT * FROM TABLE(SYSCS_DIAG.SPACE_TABLE('APP', 'T1')) x * * in which case SYSCS_DIAG.SPACE_TABLE will be mapped (internally) * to the "org.apache.derby.diag.SpaceTable" diagnostic VTI. Thus * the equivalent call prior to DERBY-2152 would have been: * * SELECT * FROM NEW org.apache.derby.diag.SpaceTable('APP', 'T1')) x * * Note that this latter syntax is still supported. */
| vtiTableConstruct | ::= | <TABLE> <LEFT_PAREN> qualifiedName methodCallParameterList <RIGHT_PAREN> |
/* * staticMethodInvocation */
| staticMethodInvocation | ::= | staticMethodName methodCallParameterList |
/** * methodCallParameterList */
| methodCallParameterList | ::= | <LEFT_PAREN> ( methodParameter ( <COMMA> methodParameter )* )? <RIGHT_PAREN> |
/* * routineInvocation */
| routineInvocation | ::= | routineExpression |
| | | distinctUDA |
/* * routineExpression */
| routineExpression | ::= | qualifiedName methodCallParameterList |
/* * distinctUDA */
| distinctUDA | ::= | qualifiedName <LEFT_PAREN> <DISTINCT> additiveExpression <RIGHT_PAREN> |
/* * javaClass */
| javaClass | ::= | javaClassName |
/* * columnMethodInvocation */
| columnMethodInvocation | ::= | columnNameForInvocation nonStaticMethodInvocation |
/* * columnNameForInvocation */
| columnNameForInvocation | ::= | identifier ( <PERIOD> identifier ( <PERIOD> identifier )? )? |
/* * columnReference */
| columnReference | ::= | identifier ( <PERIOD> identifier ( <PERIOD> identifier )? )? |
/*
void
columnReference() throws StandardException :
{}
{
/*
**
** I re-wrote the above rule because it caused a grammar ambiguitity.
** The problem is that we are parsing a dot-separated list of identifiers,
** and the grammar doesn't know what the identifiers stand for, but the
** syntax assumed that it did. For example, in schema.table.column,
** the grammar doesn't know when it parses the first identifier whether
** it will be a catalog name, schema name, table name, or column name.
**
** I think this problem could be solved by increasing the lookahead.
** I will try that solution next. I like that solution better because,
** if it works, it will be easier for the grammar to figure out what
** each identifier stands for.
**
[ |
[ [ [ ] ] ]
]
}
*/
| orderByClause | ::= | <ORDER> <BY> sortSpecificationList |
| atIsolationLevel | ::= | <WITH> isolationLevelDB2Abbrev |
| sortSpecificationList | ::= | sortSpecification ( <COMMA> sortSpecification )* |
| sortSpecification | ::= | sortKey ( orderingSpecification )? ( nullOrdering )? |
| sortKey | ::= | additiveExpression |
| orderingSpecification | ::= | <ASC> |
| | | <DESC> |
/* * The data type comparison functions need to know whether NULL values * should sort higher than non-NULL values, or lower. The answer to this * depends on whether the user specified ASCending or DESCending, and on * whether the user specified NULLS FIRST, or NULLS LAST, as follows: * * +===============+========+========+ * | ORDER BY says | ASC | DESC | * +===============+========+========+ * | NULLS FIRST | less | greater| * +===============+========+========+ * | NULLS LAST | greater| less | * +===============+========+========+ */
| nullOrdering | ::= | <NULLS> <LAST> |
| | | <NULLS> <FIRST> |
/* * offsetFetchFirstClause */
| offsetFetchFirstClause | ::= | sqlStandardOffsetFetchFirst |
| | | ( jdbcLimitOffset )? |
/* * sqlStandardOffsetFetchFirst */
| sqlStandardOffsetFetchFirst | ::= | ( offsetClause )? ( fetchFirstClause )? |
/* * jdbcLimitOffset */
| jdbcLimitOffset | ::= | <LEFT_BRACE> <LIMIT> ( intLiteral | dynamicParameterSpecification ) ( <OFFSET> ( intLiteral | dynamicParameterSpecification ) )? <RIGHT_BRACE> |
/* * offsetClause */
| offsetClause | ::= | <OFFSET> ( intLiteral | dynamicParameterSpecification ) ( <ROW> | <ROWS> ) |
/* * fetchFirstClause */
| fetchFirstClause | ::= | <FETCH> ( <FIRST> | <NEXT> ) ( intLiteral | dynamicParameterSpecification )? ( <ROW> | <ROWS> ) <ONLY> |
/* * forUpdateClause */
| forUpdateClause | ::= | <UPDATE> ( <OF> forUpdateColumnList )? |
| | | <READ> <ONLY> | |
| | | <FETCH> <ONLY> |
/* * forUpdateColumnList */
| forUpdateColumnList | ::= | forUpdateColumn ( <COMMA> forUpdateColumn )* |
/* * forUpdateColumn */
| forUpdateColumn | ::= | identifier |
/* * setClauseList */
| setClauseList | ::= | setClause ( <COMMA> setClause )* |
/* * setClause */
| setClause | ::= | columnReference <EQUALS_OPERATOR> updateSource |
/* * updateSource */
| updateSource | ::= | valueExpression |
| | | nullSpecification | |
| | | <_DEFAULT> |
/* * nullSpecification */
| nullSpecification | ::= | <NULL> |
/* * insertColumnsAndSource */
| insertColumnsAndSource | ::= | ( <LEFT_PAREN> insertColumnList <RIGHT_PAREN> )? ( propertyList <CHECK_PROPERTIES> )? queryExpression ( orderByClause )? offsetFetchFirstClause |
/* * insertColumnList */
| insertColumnList | ::= | columnQualifiedNameList |
/* * columnQualifiedNameList */
| columnQualifiedNameList | ::= | columnQualifiedNameItem ( <COMMA> columnQualifiedNameItem )* |
/* * columnQualifiedNameItem */
| columnQualifiedNameItem | ::= | columnReference |
/* * rowValueConstructor */
| rowValueConstructor | ::= | <LEFT_PAREN> rowValueConstructorList <RIGHT_PAREN> |
| | | rowValueConstructorElement |
/* * rowValueConstructorElement */
| rowValueConstructorElement | ::= | valueExpression |
| | | nullSpecification | |
| | | <_DEFAULT> | |
| | |
/* * rowValueConstructorList */
| rowValueConstructorList | ::= | rowValueConstructorElement ( <COMMA> rowValueConstructorElement )* |
/* * tableSubquery */
| tableSubquery | ::= | subquery |
/* * subquery */
| subquery | ::= | queryExpression ( orderByClause )? offsetFetchFirstClause |
/* * inPredicateValue */
| inPredicateValue | ::= | <LEFT_PAREN> ( tableSubquery | inValueList ) <RIGHT_PAREN> |
/* * inValueList */
| inValueList | ::= | inElement ( <COMMA> inElement )* |
/* * inElement */
| inElement | ::= | additiveExpression |
/* * quantifier */
| quantifier | ::= | <ALL> |
| | | some |
/* * some */
| some | ::= | <SOME> |
| | | <ANY> |
/* * existsExpression */
| existsExpression | ::= | <EXISTS> <LEFT_PAREN> tableSubquery <RIGHT_PAREN> |
/* * tableExpression */
| tableExpression | ::= | fromClause ( <WHERE> whereClause )? ( groupByClause )? ( havingClause )? ( windowClause )? ( optimizerOverridePlan )? |
/* * fromClause */
| fromClause | ::= | <FROM> ( fromListProperties )? dummyTableReferenceRule ( <COMMA> dummyTableReferenceRule )* |
/* * fromListProperties */
| fromListProperties | ::= | propertyList <CHECK_PROPERTIES> |
/* This rule created simply as a way to add the result of tableReference() * to the fromList. */
| dummyTableReferenceRule | ::= | <TABLE> tableReferenceTypes |
| | | tableReferenceTypes |
| tableReferenceTypes | ::= | tableReference |
| | | <LEFT_BRACE> <OJ> tableReference <RIGHT_BRACE> |
| optionalTableClauses | ::= | optionalTableProperties |
| | | ( ( <AS> )? identifier ( <LEFT_PAREN> derivedColumnList <RIGHT_PAREN> )? ( propertyList <CHECK_PROPERTIES> )? )? |
| optionalTableProperties | ::= | propertyList <CHECK_PROPERTIES> |
/* * tableReference */
| tableReference | ::= | tableFactor ( joinedTableExpression )* |
| tableFactor | ::= | ( newInvocation | vtiTableConstruct ) ( <AS> )? identifier ( <LEFT_PAREN> derivedColumnList <RIGHT_PAREN> )? ( optionalTableProperties )? |
| | | qualifiedName optionalTableClauses | |
| | | derivedTable ( <AS> )? identifier ( <LEFT_PAREN> derivedColumnList <RIGHT_PAREN> )? ( optionalTableProperties )? | |
| | | <LEFT_PAREN> tableReferenceTypes <RIGHT_PAREN> |
/* * derivedColumnList */
| derivedColumnList | ::= | columnNameList |
/* * columnNameList */
| columnNameList | ::= | columnNameItem ( <COMMA> columnNameItem )* |
/* * columnNameItem */
| columnNameItem | ::= | identifier |
/* * indexColumnList */
| indexColumnList | ::= | indexColumnItem ( <COMMA> indexColumnItem )* |
/* * indexColumnItem */
| indexColumnItem | ::= | identifier ( <ASC> | <DESC> )? |
/* * derivedTable */
| derivedTable | ::= | <LEFT_PAREN> tableSubquery <RIGHT_PAREN> |
| joinedTableExpression | ::= | crossJoin |
| | | qualifiedJoin | |
| | | naturalJoin |
| crossJoin | ::= | <CROSS> <JOIN> tableFactor |
| qualifiedJoin | ::= | ( joinType )? <JOIN> tableReferenceTypes joinSpecification |
| naturalJoin | ::= | <NATURAL> ( joinType )? <JOIN> tableFactor |
| joinType | ::= | <INNER> |
| | | outerJoinType ( <OUTER> )? |
| outerJoinType | ::= | <LEFT> |
| | | <RIGHT> |
| joinSpecification | ::= | joinCondition |
| | | namedColumnsJoin |
| joinCondition | ::= | <ON> valueExpression |
| namedColumnsJoin | ::= | <USING> <LEFT_PAREN> columnNameList <RIGHT_PAREN> |
/* * tableValueConstructor */
| tableValueConstructor | ::= | <VALUES> tableValueConstructorList |
/* * tableValueConstructorList */
| tableValueConstructorList | ::= | rowValueConstructor ( <COMMA> rowValueConstructor )* |
/* * explicitTable */ /* * datetimeValueFunction */
| datetimeValueFunction | ::= | <CURRENT> <DATE> |
| | | <CURRENT_DATE> | |
| | | <CURRENT> <TIME> | |
| | | <CURRENT_TIME> | |
| | | <CURRENT> <TIMESTAMP> | |
| | | <CURRENT_TIMESTAMP> |
/* ** Note that set function and aggregate are used ** interchangeably in the parser. The tree has ** aggregate nodes. */
| windowOrAggregateFunctionNode | ::= | <COUNT> <LEFT_PAREN> ( <ASTERISK> | aggregateExpression ) <RIGHT_PAREN> ( overClause )? |
| | | generalAggregate ( overClause )? | |
| | | <ROWNUMBER> <LEFT_PAREN> <RIGHT_PAREN> overClause |
| overClause | ::= | <OVER> ( <LEFT_PAREN> ( orderByClause )? <RIGHT_PAREN> | identifier ) |
| aggregateExpression | ::= | ( setQuantifier )? additiveExpression |
| generalAggregate | ::= | builtInAggregateType <LEFT_PAREN> aggregateExpression <RIGHT_PAREN> |
/* ** All built in aggregates are pretty similar to user ** defined aggregates, except we know what to map to ** without looking up the class name. ** ** NOTE: COUNT is omitted here because the COUNT aggregate is ** factored into a different rule, to distinguish between ** COUNT(*) and COUNT(). */
| builtInAggregateType | ::= | ( <MAX> | <AVG> | <MIN> | <SUM> ) |
| castSpecification | ::= | <CAST> <LEFT_PAREN> castOperand <AS> dataTypeCast <RIGHT_PAREN> |
/** * Next value from a sequence object */
| nextValueExpression | ::= | <NEXT> <VALUE> <FOR> qualifiedName |
/* * charOrVarchar */
| charOrVarchar | ::= | <CHAR> |
| | | <VARCHAR> |
| castOperand | ::= | additiveExpression |
| | | <NULL> |
/* * dynamicParameterSpecification */
| dynamicParameterSpecification | ::= | <QUESTION_MARK> |
/* * whereClause */
| whereClause | ::= | valueExpression |
| groupByClause | ::= | <GROUP> <BY> ( <ROLLUP> <LEFT_PAREN> groupingColumnReferenceList <RIGHT_PAREN> | groupingColumnReferenceList ) |
| groupingColumnReferenceList | ::= | groupingColumnReference ( <COMMA> groupingColumnReference )* |
| groupingColumnReference | ::= | additiveExpression |
| havingClause | ::= | <HAVING> valueExpression |
| windowClause | ::= | <WINDOW> windowDefinition ( <COMMA> windowDefinition )* |
| windowDefinition | ::= | identifier <AS> <LEFT_PAREN> ( orderByClause )? <RIGHT_PAREN> |
/* * optimizerOverridePlan */
| optimizerOverridePlan | ::= | <DERBYPLAN> optimizerPlan |
/* * optimizerPlan */
| optimizerPlan | ::= | optimizerJoin |
| | | optimizerRowSource |
/* * optimizerJoin */
| optimizerJoin | ::= | <LEFT_PAREN> optimizerPlan joinStrategy optimizerPlan <RIGHT_PAREN> |
/* * joinStrategy */
| joinStrategy | ::= | <ASTERISK> |
| | | <HASH> |
/* * optimizerRowSource */
| optimizerRowSource | ::= | qualifiedName ( <LEFT_PAREN> <RIGHT_PAREN> )? |
| schemaDefinition | ::= | <SCHEMA> ( identifier ( <AUTHORIZATION> identifier )? | <AUTHORIZATION> identifier ) |
/* * roleDefinition */
| roleDefinition | ::= | <ROLE> identifier |
/* * sequenceDefinition */
| sequenceDefinition | ::= | <SEQUENCE> qualifiedName ( sequenceGeneratorOption )* |
/* * sequenceGeneratorOption */
| sequenceGeneratorOption | ::= | ( <AS> exactIntegerType | <START> <WITH> exactIntegerObject | <INCREMENT> <BY> exactIntegerObject | ( ( <MAXVALUE> exactIntegerObject ) | ( <NO> <MAXVALUE> ) ) | ( ( <MINVALUE> exactIntegerObject ) | ( <NO> <MINVALUE> ) ) | cycleClause ) |
/* * cycleClause */
| cycleClause | ::= | <CYCLE> |
| | | <NO> <CYCLE> |
/* * exactNumberObject */
| exactIntegerObject | ::= | exactNumber |
/* * stepValue */
| stepValue | ::= | <INCREMENT> <BY> exactNumber |
/* * dropSequenceStatement */
| dropSequenceStatement | ::= | <SEQUENCE> qualifiedName <RESTRICT> |
/* * tableDefinition */
| tableDefinition | ::= | <TABLE> qualifiedName ( tableElementList ( propertyList <CHECK_PROPERTIES> )? | ( <LEFT_PAREN> tableColumnList <RIGHT_PAREN> )? <AS> queryExpression <WITH> ( <NO> )? <DATA> ) |
| tableColumnList | ::= | columnNameList |
/* * This method is called when a comment starting with "--derby-properties" is * found. Such a comment is a special directive to Derby and allows an SQL * statement to pass optimizer overrides. Derby looks for * * propertyName = value* [, propertyName = value]* * * after "--derby-properties" and returns these properties in a Properties * object as a return value of this method. If the parameter * "propertiesUseAllowed" is true, it indicates that users are allowed to * specify optimizer overrides in the given context. False means optimizer * overrides in the given context are allowed internally only, e.g. by the * class org.apache.derby.impl.load.Import specifies the property * "insertMode=replace/bulkInsert" in the INSERT statement. This same property * will not be acceptable from an INSERT statement from a user SQL statement. */
| propertyList | ::= | <DERBYDASHPROPERTIES> |
/* * DB2lockGranularityClause */
| DB2lockGranularityClause | ::= | <LOCKSIZE> lockGranularity |
/* * lockGranularity */
| lockGranularity | ::= | <TABLE> |
| | | <ROW> |
/* * indexDefinition */
| indexDefinition | ::= | ( unique )? <INDEX> qualifiedName <ON> qualifiedName <LEFT_PAREN> indexColumnList <RIGHT_PAREN> ( propertyList <CHECK_PROPERTIES> )? |
/* * unique */
| unique | ::= | <UNIQUE> |
/** CREATE PROCEDURE procedureElements contains the description of the procedure. (CREATE FUNCTIONS shares this lyout), see functionDefinition 0 - Object[] 3 element array for parameters 1 - TableName - specific name 2 - Integer - dynamic result set count 3 - String language (always java) - ignore 4 - String external name (also passed directly to create alias node - ignore 5 - Short parameter style (always java) - ignore 6 - Short - SQL allowed. 7 - Boolean - CALLED ON NULL INPUT (always TRUE for procedures) 8 - TypeDescriptor - return type (always NULL for procedures) */
| procedureDefinition | ::= | <PROCEDURE> qualifiedName procedureParameterList ( routineElement )+ |
| routineElement | ::= | ( <SPECIFIC> qualifiedName | ( <DYNAMIC> )? <RESULT> <SETS> uint_value | <LANGUAGE> <JAVA> | <DETERMINISTIC> | <NOT> <DETERMINISTIC> | <EXTERNAL> ( <NAME> string | <SECURITY> ) | <PARAMETER> <STYLE> parameterStyle | <NO> <SQL> | <CONTAINS> <SQL> | <READS> <SQL> <DATA> | <MODIFIES> <SQL> <DATA> | calledOnNullInput ) |
| calledOnNullInput | ::= | ( <CALLED> | <RETURNS> <NULL> ) <ON> <NULL> <INPUT> |
| routineSecurityClause | ::= | ( <INVOKER> | <DEFINER> ) |
| parameterStyle | ::= | <JAVA> |
| | | <DERBY_JDBC_RESULT_SET> | |
| | | <DERBY> |
| procedureParameterList | ::= | <LEFT_PAREN> ( procedureParameterDefinition ( <COMMA> procedureParameterDefinition )* ( ellipsis )? )? <RIGHT_PAREN> |
/* * procedureParameterDefinition */
| procedureParameterDefinition | ::= | inoutParameter ( identifier )? dataTypeDDL |
| inoutParameter | ::= | ( <IN> | <OUT> | <INOUT> )? |
/** CREATE FUNCTION functionElements contains the description of the function. 0 - Object[] 3 element array for parameters 1 - TableName - specific name 2 - Integer - dynamic result set count - always 0 3 - String language (always java) - required to be set 4 - String external name (also passed directly to create alias node - ignore 5 - Short parameter style (always java) - required to be set 6 - Short - SQL allowed. 7 - Boolean - CALLED ON NULL INPUT 8 - TypeDescriptor - return type */
| functionDefinition | ::= | <FUNCTION> qualifiedName functionParameterList <RETURNS> functionReturnDataType ( routineElement )+ |
| functionParameterList | ::= | <LEFT_PAREN> ( functionParameterDefinition ( <COMMA> functionParameterDefinition )* ( ellipsis )? )? <RIGHT_PAREN> |
| ellipsis | ::= | <ELLIPSIS> |
/* * functionParameterDefinition */
| functionParameterDefinition | ::= | ( identifier )? dataTypeDDL |
/* * functionReturnDataType */
| functionReturnDataType | ::= | ( catalogType | functionTableType ) |
/* * functionTableType */
| functionTableType | ::= | <TABLE> <LEFT_PAREN> functionTableReturnColumn ( <COMMA> functionTableReturnColumn )* <RIGHT_PAREN> |
/* * functionTableReturnColumn */
| functionTableReturnColumn | ::= | identifier dataTypeDDL |
/** CREATE TYPE */
| udtDefinition | ::= | <TYPE> qualifiedName <EXTERNAL> <NAME> string <LANGUAGE> <JAVA> |
| aggregateDefinition | ::= | <DERBY> <AGGREGATE> qualifiedName <FOR> dataTypeDDL ( <RETURNS> dataTypeDDL )? <EXTERNAL> <NAME> string |
| viewDefinition | ::= | <VIEW> qualifiedName ( <LEFT_PAREN> viewColumnList <RIGHT_PAREN> )? <AS> queryExpression ( orderByClause )? offsetFetchFirstClause |
| viewColumnList | ::= | columnNameList |
| triggerDefinition | ::= | <TRIGGER> qualifiedName beforeOrAfter triggerEvent <ON> qualifiedName ( triggerReferencingClause )? ( <FOR> <EACH> rowOrStatement )? ( <MODE> <DB2SQL> )? ( <WHEN> <LEFT_PAREN> valueExpression <RIGHT_PAREN> )? proceduralStatement |
| synonymDefinition | ::= | <SYNONYM> qualifiedName <FOR> qualifiedName |
| beforeOrAfter | ::= | <NO> <CASCADE> <BEFORE> |
| | | <AFTER> |
| triggerEvent | ::= | <INSERT> |
| | | <DELETE> | |
| | | <UPDATE> ( <OF> columnNameList )? |
| rowOrStatement | ::= | <ROW> |
| | | <STATEMENT> |
| triggerReferencingClause | ::= | <REFERENCING> triggerReferencingExpression ( triggerReferencingExpression )* |
| triggerReferencingExpression | ::= | ( <NEW> ( <ROW> | <TABLE> )? | <OLD> ( <ROW> | <TABLE> )? | <NEW_TABLE> | <OLD_TABLE> ) <AS> identifier |
/* * defaultClause */
| defaultClause | ::= | ( <WITH> )? <_DEFAULT> defaultOption |
| | | generatedColumnOption |
/* * defaultNullOnlyClause */
| defaultNullOnlyClause | ::= | <_DEFAULT> <NULL> |
/* * generatedColumnOption */ //ToCleanUp //A specific class not such long[] should exists for autoIncrementInfo ...
| generatedColumnOption | ::= | <GENERATED> ( generatedAlways | generatedByDefault ) |
/* * generatedAlways */
| generatedAlways | ::= | <ALWAYS> ( asIdentity | generationClause ) |
/* * generatedByDefault */
| generatedByDefault | ::= | <BY> <_DEFAULT> asIdentity |
/* * asIdentity */
| asIdentity | ::= | <AS> <IDENTITY> ( <LEFT_PAREN> autoIncrementBeginEnd <RIGHT_PAREN> )? |
/* * generationClause */
| generationClause | ::= | <AS> <LEFT_PAREN> valueExpression <RIGHT_PAREN> |
/* * autoIncrementBeginEnd */
| autoIncrementBeginEnd | ::= | ( ( identityColumnOption )* ) |
/* * identityColumnOption */
| identityColumnOption | ::= | ( <START> <WITH> exactNumber | <INCREMENT> <BY> exactNumber | <CYCLE> | <NO> <CYCLE> | <COMMA> ( | ) ) |
/* * whetherCycle */
| whetherCycle | ::= |
/* * defaultOption */
| defaultOption | ::= | <NULL> |
| | | DB2DefaultOption |
/* * DB2DefaultOption */
| DB2DefaultOption | ::= | <CURRENT> ( <SCHEMA> | <SQLID> ) |
| | | userNode | |
| | | currentRoleNode | |
| | | miscBuiltins | |
| | | miscBuiltins | |
| | | datetimeValueFunction | |
| | | literal |
/* * literal */
| literal | ::= | ( sign )? numericLiteral |
| | | stringLiteral | |
| | | hexLiteral | |
| | | dateTimeLiteral | |
| | | booleanLiteral |
/* * intLiteral */
| intLiteral | ::= | ( sign )? <EXACT_NUMERIC> |
/* * numericLiteral */
| numericLiteral | ::= | <EXACT_NUMERIC> |
| | | <APPROXIMATE_NUMERIC> |
/* * dateTimeLiteral */
| dateTimeLiteral | ::= | ( ( <LEFT_BRACE> escapedDateTimeLiteral <RIGHT_BRACE> ) ) |
/* * escapedDateTimeLiteral */
| escapedDateTimeLiteral | ::= | <D> bareDateLiteral |
| | | <T> bareTimeLiteral | |
| | | <TS> bareTimestampLiteral |
/* * bareDateLiteral */
| bareDateLiteral | ::= | string |
/* * bareTimeLiteral */
| bareTimeLiteral | ::= | string |
/* * bareTimestampLiteral */
| bareTimestampLiteral | ::= | string |
/* * string */
| string | ::= | <STRING> |
/* * stringLiteral */
| stringLiteral | ::= | <STRING> |
/* * hexLiteral */
| hexLiteral | ::= | <HEX_STRING> |
| constraintNameDefinition | ::= | <CONSTRAINT> qualifiedName |
/* * DB2 requires column check constraints to refer to only that column. Derby * doesn't care if check constraints are column level or table level. For DB2 compatibility * check that column check constraints only refer to that column. */
| checkConstraintDefinition | ::= | <CHECK> <LEFT_PAREN> valueExpression <RIGHT_PAREN> |
/* * spsRenameStatement */
| spsRenameStatement | ::= | <RENAME> ( renameTableStatement | renameIndexStatement | renameColumnStatement ) |
/* * renameTableStatement */
| renameTableStatement | ::= | <TABLE> qualifiedName <TO> identifier |
/* * renameIndexStatement */
| renameIndexStatement | ::= | <INDEX> identifier <TO> identifier |
| renameColumnStatement | ::= | <COLUMN> columnReference <TO> identifier |
| lockStatement | ::= | <LOCK> <TABLE> qualifiedName <IN> lockMode <MODE> |
| lockMode | ::= | <EXCLUSIVE> |
| | | <SHARE> |
| execStatement | ::= | <EXECUTE> <STATEMENT> qualifiedName |
| setIsolationStatement | ::= | setIsolationHeader ( ( <EQUALS_OPERATOR> | <TO> ) )? transactionMode |
| setIsolationHeader | ::= | <ISOLATION> |
| | | <CURRENT> <ISOLATION> |
| transactionMode | ::= | isolationLevelDB2OrReset |
| isolationLevelDB2OrReset | ::= | ( <RESET> | isolationLevelDB2 ) |
| isolationLevelDB2 | ::= | ( isolationLevelDB2Abbrev | ( ( <REPEATABLE> <READ> ) | <SERIALIZABLE> ) | <CURSOR> <STABILITY> | <DIRTY> <READ> | <READ> <COMMITTED> | <READ> <UNCOMMITTED> ) |
| isolationLevelDB2Abbrev | ::= | ( <RR> | <RS> | <CS> | <UR> ) |
| isolationLevel | ::= | <ISOLATION> <LEVEL> levelOfIsolation |
| levelOfIsolation | ::= | <READ> |
| | | <REPEATABLE> <READ> | |
| | | <SERIALIZABLE> |
| levelOfIsolationRead | ::= | <UNCOMMITTED> |
| | | <COMMITTED> |
/* * simpleValueSpecification */
| simpleValueSpecification | ::= | literal |
/* * setRoleStatement */
| setRoleStatement | ::= | <ROLE> setRoleSpecification |
/* * setRoleSpecification */
| setRoleSpecification | ::= | <NONE> |
| | | identifier | |
| | | dynamicParameterSpecification | |
| | | string |
| setSchemaStatement | ::= | setSchemaHeader ( <EQUALS_OPERATOR> )? setSchemaValues |
| setSchemaHeader | ::= | <SCHEMA> |
| | | <CURRENT> ( <SCHEMA> | <SQLID> ) |
| setSchemaValues | ::= | identifier |
| | | <USER> | |
| | | dynamicParameterSpecification | |
| | | string |
// Set the locale for messages coming from the database system. This // is for support only, so we can get messages in our preferred language // (usually English). I didn't want to create all the execution wiring // to do this, so this command executes in the parser
| setMessageLocaleStatement | ::= | <MESSAGE_LOCALE> string |
/* * valueSpecification */
| valueSpecification | ::= | literal |
| | | generalValueSpecification | |
| | | <NULLIF> <LEFT_PAREN> valueExpression <COMMA> valueExpression <RIGHT_PAREN> | |
| | | <CASE> searchedCaseExpression | |
| | | <CASE> valueExpression simpleCaseExpression |
| searchedCaseExpression | ::= | ( whenThenExpression )+ ( <ELSE> thenElseExpression )? <END> |
/* * whenThenExpression */
| whenThenExpression | ::= | <WHEN> valueExpression <THEN> thenElseExpression |
/* * thenElseExpression */
| thenElseExpression | ::= | <NULL> |
| | | valueExpression |
| simpleCaseExpression | ::= | ( simpleWhenClause )+ ( <ELSE> thenElseExpression )? <END> |
| simpleWhenClause | ::= | <WHEN> whenOperandList <THEN> thenElseExpression |
| whenOperandList | ::= | whenOperand ( <COMMA> whenOperandList )? |
| whenOperand | ::= | remainingPredicate |
| | | valueExpression |
| tableConstraintDefinition | ::= | ( constraintNameDefinition )? tableConstraint ( propertyList <CHECK_PROPERTIES> )? |
| tableConstraint | ::= | ( uniqueConstraintDefinition | referentialConstraintDefinition | checkConstraintDefinition ) ( constraintCharacteristics )? |
| uniqueConstraintDefinition | ::= | uniqueSpecification <LEFT_PAREN> uniqueColumnList <RIGHT_PAREN> |
//the second parameter to the following method will always be null for a table level //constraint but not for a column level constraint
| uniqueSpecification | ::= | <UNIQUE> |
| | | <PRIMARY> <KEY> |
| uniqueColumnList | ::= | columnNameList |
| referentialConstraintDefinition | ::= | <FOREIGN> <KEY> <LEFT_PAREN> columnNameList <RIGHT_PAREN> referencesSpecification |
| referencesSpecification | ::= | <REFERENCES> referencedTableAndColumns ( <ON> referentialTriggeredAction )? |
| referencedTableAndColumns | ::= | qualifiedName ( <LEFT_PAREN> columnNameList <RIGHT_PAREN> )? |
| referentialTriggeredAction | ::= | ( updateRule ( <ON> deleteRule )? | deleteRule ( <ON> updateRule )? ) |
| updateRule | ::= | <UPDATE> updateReferentialAction |
| deleteRule | ::= | <DELETE> deleteReferentialAction |
| updateReferentialAction | ::= | <RESTRICT> |
| | | <NO> <ACTION> |
| deleteReferentialAction | ::= | <CASCADE> |
| | | <RESTRICT> | |
| | | <NO> <ACTION> | |
| | | <SET> ( <NULL> | <_DEFAULT> ) |
/* * constraintCharacteristics */
| constraintCharacteristics | ::= | ( ( initiallyDeferred ) ( deferrable )? ( constraintEnforcement )? | ( deferrable ) ( initiallyDeferred )? ( constraintEnforcement )? | constraintEnforcement ) |
/* * initiallyDeferred */
| initiallyDeferred | ::= | <INITIALLY> ( <IMMEDIATE> | <DEFERRED> ) |
/* * deferrable */
| deferrable | ::= | ( <NOT> )? <DEFERRABLE> |
/* * constraintEnforcement */
| constraintEnforcement | ::= | ( <NOT> )? <ENFORCED> |
/* * columnConstraintDefinition */
| columnConstraintDefinition | ::= | ( constraintNameDefinition )? columnConstraint ( constraintCharacteristics )? |
/* * columnConstraint */
| columnConstraint | ::= | <NOT> <NULL> |
| | | uniqueSpecification ( propertyList <CHECK_PROPERTIES> )? | |
| | | referencesSpecification ( propertyList <CHECK_PROPERTIES> )? | |
| | | checkConstraintDefinition |
/* * dropRoleStatement */
| dropRoleStatement | ::= | <ROLE> identifier |
| dropSchemaStatement | ::= | <SCHEMA> identifier <RESTRICT> |
| alterTableStatement | ::= | <TABLE> qualifiedName alterTableBody |
| alterTableBody | ::= | <COMPRESS> ( inplaceCompress | sequentialCompress ) |
| | | <ALL> ( dropStatistics | updateStatistics ) | |
| | | <UPDATE> <STATISTICS> ( identifier ) | |
| | | <STATISTICS> <DROP> ( identifier ) | |
| | | <DROP> ( dropColumnDefinition | dropTableConstraintDefinitionCore ) | |
| | | alterTableAction |
/* * Called for ALTER TABLE ALL DROP STATISTICS. This is an internal * syntax and can't be invoked by a user directly. DERBY-4115. This * will drop all the statistics for the given table name * * By the time we get here, we've parsed * ALTER TABLE tablename ALL * and here we parse DROP STATISTICS clause */
| dropStatistics | ::= | <DROP> <STATISTICS> |
/* * Called for ALTER TABLE ALL UPDATE STATISTICS. This is an internal * syntax and can't be invoked by a user directly. DERBY-269. This * will update all the statistics for the given table name * * By the time we get here, we've parsed * ALTER TABLE tablename ALL * and here we parse UPDATE STATISTICS clause */
| updateStatistics | ::= | <UPDATE> <STATISTICS> |
| inplaceCompress | ::= | <INPLACE> ( ( <PURGE> )? ( <DEFRAGMENT> )? ( <TRUNCATE_END> )? ) |
| sequentialCompress | ::= | ( <SEQUENTIAL> )? |
/*
* alterTableRenameTableStatement
*/
/*
StatementNode
alterTableRenameTableStatement(TableName tableName) throws StandardException :
{
String newTableName;
}
{
newTableName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
{
return new RenameNode(
null,
newTableName,
true,
StatementType.RENAME_TABLE,
getContextManager());
}
}
*/
/*
* alterTableRenameColumnStatement
*/
/*
StatementNode
alterTableRenameColumnStatement(TableName tableName) throws StandardException :
{
String oldColumnName;
String newColumnName;
}
{
oldColumnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) newColumnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
{
return new RenameNode(
tableName,
oldColumnName,
newColumnName,
true,
StatementType.RENAME_COLUMN,
getContextManager());
}
}
*/
| alterTableAction | ::= | <ADD> ( addColumnDefinition | tableConstraintDefinition ) |
| | | <ALTER> ( <COLUMN> )? identifier columnAlterClause | |
| | | <ALTER> constraintNameDefinition constraintEnforcement | |
| | | DB2lockGranularityClause |
/* * Handle * * ALTER TABLE tablename DROP [ COLUMN ] columnname [ CASCADE | RESTRICT ] */
| dropColumnDefinition | ::= | ( <COLUMN> )? identifier dropColumnReferentialAction |
| dropColumnReferentialAction | ::= | ( <CASCADE> | <RESTRICT> )? |
| addColumnDefinition | ::= | ( <COLUMN> )? columnDefinition |
/* * Various variants of the ALTER TABLE ALTER COLUMN statement. * * By the time we get here, we've parsed * ALTER TABLE tablename ALTER [COLUMN] columnname * and here we parse the remainder of the ALTER COLUMN clause, one of: * SET DATA TYPE data_type * SET INCREMENT BY increment_value * RESTART WITH increment_restart_value * [SET | WITH] DEFAULT default_value * DROP DEFAULT * SET NOT NULL * DROP NOT NULL * [NOT] NULL */
| columnAlterClause | ::= | <SET> <DATA> <TYPE> dataTypeDDL |
| | | <RESTART> <WITH> exactNumber | |
| | | <SET> <GENERATED> alterGeneratedColumn | |
| | | <SET> columnAlterIdentityClause | |
| | | ( <SET> )? defaultClause | |
| | | <DROP> <_DEFAULT> | |
| | | ( <NULL> | <DROP> <NOT> <NULL> ) | |
| | | ( <NOT> <NULL> | <SET> <NOT> <NULL> ) |
/* * Various variants of the ALTER TABLE ALTER COLUMN SET statement. * * By the time we get here, we've parsed * ALTER TABLE tablename ALTER [COLUMN] columnname SET * INCREMENT BY increment_value * [NO] CYCLE */
| columnAlterIdentityClause | ::= | <INCREMENT> <BY> exactNumber |
| | | <CYCLE> | |
| | | <NO> <CYCLE> |
/* * Various variants of the ALTER TABLE ALTER COLUMN SET GENERATED statement. * * By the time we get here, we've parsed * ALTER TABLE ALTER COLUMN SET GENERATED */
| alterGeneratedColumn | ::= | <BY> <_DEFAULT> |
| | | <ALWAYS> |
| dropTableConstraintDefinitionCore | ::= | dropTableConstraintDefinition |
| dropTableConstraintDefinition | ::= | <CONSTRAINT> qualifiedName |
| | | <PRIMARY> <KEY> | |
| | | <FOREIGN> <KEY> qualifiedName | |
| | | <UNIQUE> qualifiedName | |
| | | <CHECK> qualifiedName |
/* * dropTableStatement */
| dropTableStatement | ::= | <TABLE> qualifiedName |
/* * dropIndexStatement */
| dropIndexStatement | ::= | <INDEX> qualifiedName |
/* * dropAliasStatement */
| dropAliasStatement | ::= | <PROCEDURE> qualifiedName |
| | | <FUNCTION> qualifiedName | |
| | | <SYNONYM> qualifiedName | |
| | | <TYPE> qualifiedName <RESTRICT> | |
| | | <DERBY> <AGGREGATE> qualifiedName <RESTRICT> |
| dropViewStatement | ::= | <VIEW> qualifiedName |
| dropTriggerStatement | ::= | <TRIGGER> qualifiedName |
| truncateTableStatement | ::= | <TRUNCATE> <TABLE> qualifiedName |
/* * grantStatement */
| grantStatement | ::= | <GRANT> ( tableGrantStatement | routineGrantStatement | usageGrantStatement ) |
| | | <GRANT> ( roleGrantStatement ) |
/* * tableGrantStatement */
| tableGrantStatement | ::= | tablePrivileges <TO> granteeList |
// end of tableGrantStatement /* * tablePrivileges */
| tablePrivileges | ::= | tableActions <ON> ( <TABLE> )? qualifiedName |
// end of tablePrivilege /* * tableActions */
| tableActions | ::= | <ALL> <PRIVILEGES> |
| | | tableAction ( <COMMA> tableAction )* |
// end of tableActions /* * routineGrantStatement */
| routineGrantStatement | ::= | <EXECUTE> <ON> routineDesignator <TO> granteeList |
// end of routineGrantStatement /* * usageGrantStatement */
| usageGrantStatement | ::= | <USAGE> <ON> usableObjects qualifiedName <TO> granteeList |
// end of usageGrantStatement /* * usableObjects */
| usableObjects | ::= | <DERBY> <AGGREGATE> |
| | | <SEQUENCE> | |
| | | <TYPE> |
// end of routineGrantStatement /* * routineAlias */
| routineDesignator | ::= | ( <FUNCTION> | <PROCEDURE> ) qualifiedName ( <LEFT_PAREN> parameterTypeList <RIGHT_PAREN> )? |
// end of routineDesignator /* * parameterTypeList */
| parameterTypeList | ::= | ( catalogType ( <COMMA> catalogType )* )? |
// end of parameterTypeList /* * tableAction */
| tableAction | ::= | <SELECT> ( privilegeColumnList )? |
| | | <DELETE> | |
| | | <INSERT> | |
| | | <UPDATE> ( privilegeColumnList )? | |
| | | <REFERENCES> ( privilegeColumnList )? | |
| | | <TRIGGER> |
// end of tableAction /* * privilegeColumnList */
| privilegeColumnList | ::= | <LEFT_PAREN> columnNameList <RIGHT_PAREN> |
// end of privilegeColumnList /* * granteeList */
| granteeList | ::= | grantee ( <COMMA> grantee )* |
| grantee | ::= | identifier |
| | | <PUBLIC> |
/* * roleGrantStatement */
| roleGrantStatement | ::= | roleList <TO> granteeList |
/* * roleList */
| roleList | ::= | roleElement ( <COMMA> roleElement )* |
/* * roleElement */
| roleElement | ::= | identifier |
/* * revokeStatement */
| revokeStatement | ::= | <REVOKE> ( tableRevokeStatement | routineRevokeStatement | usageRevokeStatement ) |
| | | <REVOKE> ( roleRevokeStatement ) |
/* * tableRevokeStatement */
| tableRevokeStatement | ::= | tablePrivileges <FROM> granteeList |
// end of tableRevokeStatement /* * routineRevokeStatement */
| routineRevokeStatement | ::= | <EXECUTE> <ON> routineDesignator <FROM> granteeList <RESTRICT> |
// end of routineRevokeStatement /* * usageRevokeStatement */
| usageRevokeStatement | ::= | <USAGE> <ON> usableObjects qualifiedName <FROM> granteeList <RESTRICT> |
// end of usageRevokeStatement /* * roleRevokeStatement */
| roleRevokeStatement | ::= | roleList <FROM> granteeList |
/* * identifier */
| internalIdentifier | ::= | <IDENTIFIER> |
| | | delimitedIdentifier | |
| | | nonReservedKeyword |
| identifier | ::= | internalIdentifier |
/* * delimitedIdentifier */
| delimitedIdentifier | ::= | <DELIMITED_IDENTIFIER> |
/* * reservedKeyword */
| reservedKeyword | ::= | ( <ADD> | <ALL> | <ALLOCATE> | <ALTER> | <AND> | <ANY> | <ARE> | <AS> | <ASC> | <ASSERTION> | <AT> | <AUTHORIZATION> | <AVG> | <BEGIN> | <BETWEEN> | <BIT> | <BOTH> | <BY> | <CASCADE> | <CASCADED> | <CASE> | <CAST> | <CHAR> | <CHARACTER> | <CHECK> | <CLOSE> | <COLLATE> | <COLLATION> | <COLUMN> | <COMMIT> | <CONNECT> | <CONNECTION> | <CONSTRAINT> | <CONSTRAINTS> | <CONTINUE> | <CONVERT> | <CORRESPONDING> | <CREATE> | <CROSS> | <CURRENT> | <CURRENT_DATE> | <CURRENT_TIME> | <CURRENT_TIMESTAMP> | <CURRENT_USER> | <CURSOR> | <DEALLOCATE> | <DEC> | <DECIMAL> | <DECLARE> | <_DEFAULT> | <DEFERRABLE> | <DEFERRED> | <DELETE> | <DESC> | <DESCRIBE> | <DIAGNOSTICS> | <DISCONNECT> | <DISTINCT> | <DOUBLE> | <DROP> | <ELSE> | <END> | <ENDEXEC> | <ESCAPE> | <EXCEPT> | <EXCEPTION> | <EXEC> | <EXECUTE> | <EXISTS> | <EXTERNAL> | <FALSE> | <FETCH> | <FIRST> | <FLOAT> | <FOR> | <FOREIGN> | <FOUND> | <FROM> | <FULL> | <FUNCTION> | <GET> | <GET_CURRENT_CONNECTION> | <GLOBAL> | <GO> | <GOTO> | <GRANT> | <GROUP> | <HAVING> | <HOUR> | <IDENTITY> | <IMMEDIATE> | <IN> | <INDICATOR> | <INITIALLY> | <INNER> | <INOUT> | <INPUT> | <INSENSITIVE> | <INSERT> | <INT> | <INTEGER> | <INTERSECT> | <INTO> | <IS> | <ISOLATION> | <JOIN> | <KEY> | <LAST> | <LEADING> | <LEFT> | <LIKE> | <LOWER> | <MATCH> | <MAX> | <MIN> | <MINUTE> | <NATIONAL> | <NATURAL> | <NCHAR> | <NVARCHAR> | <NEXT> | <NO> | <NONE> | <NOT> | <NULL> | <NULLIF> | <NUMERIC> | <OF> | <ON> | <ONLY> | <OPEN> | <OPTION> | <OR> | <ORDER> | <OUT> | <OUTER> | <OUTPUT> | <OVERLAPS> | <PAD> | <PARTIAL> | <PREPARE> | <PRESERVE> | <PRIMARY> | <PRIOR> | <PRIVILEGES> | <PROCEDURE> | <PUBLIC> | <READ> | <REAL> | <REFERENCES> | <RELATIVE> | <RESTRICT> | <REVOKE> | <RIGHT> | <ROLLBACK> | <ROWS> | <SCHEMA> | <SCROLL> | <SECOND> | <SELECT> | <SESSION_USER> | <SET> | <SMALLINT> | <SOME> | <SPACE> | <SQL> | <SQLCODE> | <SQLERROR> | <SQLSTATE> | <SUBSTRING> | <SUM> | <SYSTEM_USER> | <TABLE> | <TEMPORARY> | <TIMEZONE_HOUR> | <TIMEZONE_MINUTE> | <TO> | <TRAILING> | <TRANSACTION> | <TRANSLATE> | <TRANSLATION> | <TRUE> | <UNION> | <UNIQUE> | <UNKNOWN> | <UPDATE> | <UPPER> | <USER> | <USING> | <VALUES> | <VARCHAR> | <VARYING> | <VIEW> | <WHENEVER> | <WHERE> | <WITH> | <WORK> | <WRITE> | <YEAR> | <BOOLEAN> | <CALL> | <CURRENT_ROLE> | <EXPLAIN> | <BIGINT> | <LTRIM> | <RTRIM> | <TRIM> | <SUBSTR> | <XML> | <XMLPARSE> | <XMLSERIALIZE> | <XMLEXISTS> | <XMLQUERY> ) |
/* * nonReservedKeyword */
| nonReservedKeyword | ::= | ( <ABS> | <ABSVAL> | <ACTION> | <AFTER> | <AGGREGATE> | <ALWAYS> | <BEFORE> | <BINARY> | <BLOB> | <C> | <CALLED> | <CLASS> | <CLOB> | <COALESCE> | <COBOL> | <COMMITTED> | <COMPRESS> | <CONCAT> | <CONTAINS> | <CONTENT> | <COUNT> | <CS> | <CURDATE> | <CURTIME> | <CYCLE> | <D> | <DATA> | <DATE> | <DAY> | <DEFRAGMENT> | <DIRTY> | <DYNAMIC> | <DATABASE> | <DB2SQL> | <DERBY> | <DERBY_JDBC_RESULT_SET> | <DOCUMENT> | <ENFORCED> | <EACH> | <EMPTY> | <EXCLUSIVE> | <FN> | <FORTRAN> | <GENERATED> | <IDENTITY_VAL_LOCAL> | <INCREMENT> | <INDEX> | <INITIAL> | <INPLACE> | <INTERVAL> | <JAVA> | <LANGUAGE> | <LARGE> | <LCASE> | <LENGTH> | <LEVEL> | <LIMIT> | <LOCATE> | <LOCK> | <LOCKS> | <LOCKSIZE> | <LOGGED> | <LONG> | <MATCHED> | <MAXVALUE> | <MERGE> | <MINVALUE> | <MESSAGE_LOCALE> | <METHOD> | <MOD> | <MODE> | <MODIFIES> | <MODIFY> | <MODULE> | <MONTH> | <_MORE> | <MUMPS> | <NAME> | <NCLOB> | <NEW> | <NEW_TABLE> | <NULLABLE> | <NULLS> | <NUMBER> | <OBJECT> | <OFF> | <OFFSET> | <OLD> | <OLD_TABLE> | <OJ> | <OVER> | <PASCAL> | <PASSING> | <PLI> | <PRECISION> | <PROPERTIES> | <PURGE> | <READS> | <REF> | <RELEASE> | <RENAME> | <REPEATABLE> | <REFERENCING> | <RESET> | <RESTART> | <RESULT> | <RETAIN> | <RETURNING> | <RETURNS> | <ROLE> | <ROLLUP> | <ROW> | <ROWNUMBER> | <RR> | <RS> | <SCALE> | <SAVEPOINT> | <SECURITY> | <SEQUENCE> | <SEQUENTIAL> | <SERIALIZABLE> | <SETS> | <SHARE> | <SPECIFIC> | <SQLID> | <SQL_TSI_FRAC_SECOND> | <SQL_TSI_SECOND> | <SQL_TSI_MINUTE> | <SQL_TSI_HOUR> | <SQL_TSI_DAY> | <SQL_TSI_WEEK> | <SQL_TSI_MONTH> | <SQL_TSI_QUARTER> | <SQL_TSI_YEAR> | <SQRT> | <STABILITY> | <START> | <STATEMENT> | <STATISTICS> | <STRIP> | <SYNONYM> | <STYLE> | <T> | <THEN> | <TIME> | <TIMESTAMP> | <TIMESTAMPADD> | <TIMESTAMPDIFF> | <TRIGGER> | <TRUNCATE> | <TRUNCATE_END> | <TS> | <TYPE> | <UCASE> | <UNCOMMITTED> | <UR> | <USAGE> | <VALUE> | <VARBINARY> | <PARAMETER> | <WHEN> | <WHITESPACE> ) |
/* * caseSensitiveIdentifierPlusReservedWords */
| caseSensitiveIdentifierPlusReservedWords | ::= | caseSensitiveIdentifier |
| | | reservedKeyword |
/* * caseInsensitiveIdentifierPlusReservedWords */
| caseInsensitiveIdentifierPlusReservedWords | ::= | identifier |
| | | reservedKeyword |
/* * caseSensitiveIdentifier */
| caseSensitiveIdentifier | ::= | <IDENTIFIER> |
| | | delimitedIdentifier | |
| | | nonReservedKeyword |