/* * Statement */
| Statement | ::= | StatementPart <EOF> |
| proceduralStatement | ::= | ( insertStatement | preparableUpdateStatement | preparableDeleteStatement | preparableSelectStatement ) |
/* * StatementPart * * @param tokenHolder returns the token that starts * the statement. If null, ignored. */
| StatementPart | ::= | ( spsRenameStatement | lockStatement ) |
| | | ( createStatements | dropStatements | spsAlterStatement | globalTemporaryTableDeclaration | preparableSQLDataStatement | spsSetStatement | truncateTableStatement | execStatement ) |
/* * spsCreateStatement */
| createStatements | ::= | <CREATE> ( ( schemaDefinition | viewDefinition | triggerDefinition | synonymDefinition ) | tableDefinition | procedureDefinition | functionDefinition | indexDefinition ) |
/* * spsDropStatement */
| dropStatements | ::= | <DROP> ( dropSchemaStatement | dropTableStatement | dropIndexStatement | dropAliasStatement | dropViewStatement | dropTriggerStatement ) |
/* * spsAlterStatement */
| spsAlterStatement | ::= | <ALTER> ( alterTableStatement ) |
/* * spsSetStatement */
| spsSetStatement | ::= | <SET> ( setIsolationStatement | setSchemaStatement | setMessageLocaleStatement ) |
| | | <SET> ( setSchemaStatement | setIsolationStatement ) |
/* * 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 | |
| | | preparableUpdateStatement | |
| | | callStatement | |
| | | savepointStatement |
/* * preparableDeleteStatement * * This may be a search or positioned delete statement. */
| preparableDeleteStatement | ::= | <DELETE> deleteBody |
| deleteBody | ::= | <FROM> newInvocation ( <WHERE> whereClause )? |
| | | <FROM> qualifiedName ( propertyList )? ( <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 )? ( <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 ( propertyList )? <SET> setClauseList ( <WHERE> ( whereClause | currentOfClause ) )? |
/* * callStatement */
| callStatement | ::= | ( bareCallStatement | <LEFT_BRACE> bareCallStatement <RIGHT_BRACE> ) |
/* * baseCallStatement */
| bareCallStatement | ::= | <CALL> primaryExpression |
| | | dynamicParameterSpecification <EQUALS_OPERATOR> <CALL> rowValueConstructor |
/* * primaryExpression * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| 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 |
/* * dataTypeCast */
| dataTypeCast | ::= | dataTypeCommon |
/* * 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> | |
| | | <LONGINT> |
/* * 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 | ::= | javaClassName |
/* * 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> |
/* * timePrecision */
| qualifiedNameList | ::= | qualifiedNameElement ( <COMMA> qualifiedNameElement )* |
| qualifiedNameElement | ::= | qualifiedName |
/* * 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 <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 | ::= | additiveExpression ( asClause )? |
/* * asClause */
| asClause | ::= | ( <AS> )? identifier |
/* * valueExpression * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| valueExpression | ::= | orExpression ( <OR> orExpression )* |
/* * orExpression * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| orExpression | ::= | andExpression ( <AND> andExpression )* |
/* * andExpression * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| andExpression | ::= | ( <NOT> )? isSearchCondition |
/* * isSearchCondition * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| isSearchCondition | ::= | booleanPrimary ( <IS> ( <NOT> )? <NULL> )? |
/* * booleanPrimary * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| booleanPrimary | ::= | predicate |
/* * predicate * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| predicate | ::= | ( additiveExpression | existsExpression ) ( remainingPredicate )* |
/* * remainingPredicates * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| remainingPredicate | ::= | remainingNonNegatablePredicate |
| | | ( <NOT> )? remainingNegatablePredicate |
/* * remainingNonNegatablePredicate * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| remainingNonNegatablePredicate | ::= | compOp ( ( quantifier <LEFT_PAREN> tableSubquery <RIGHT_PAREN> ) | ( additiveExpression ) ) |
/* * remainingNegatablePredicate * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| remainingNegatablePredicate | ::= | <IN> inPredicateValue |
| | | <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 * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| additiveExpression | ::= | multiplicativeExpression ( additiveOperator multiplicativeExpression )* |
/* * additiveOperator */
| additiveOperator | ::= | <PLUS_SIGN> |
| | | <MINUS_SIGN> |
/* * multiplicativeExpression * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| multiplicativeExpression | ::= | unaryExpression ( multiplicativeOperator unaryExpression )* |
/* * multiplicativeOperator */
| multiplicativeOperator | ::= | <ASTERISK> |
| | | <SOLIDUS> | |
| | | <CONCATENATION_OPERATOR> |
/* * unaryExpression * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| unaryExpression | ::= | ( sign )? primaryExpression |
/* * sign */
| sign | ::= | <PLUS_SIGN> |
| | | <MINUS_SIGN> |
/* * primaryExpressionXX * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| primaryExpressionXX | ::= | primary ( nonStaticMethodCallOrFieldAccess )* |
| nonStaticMethodCallOrFieldAccess | ::= | nonStaticMethodInvocation |
/* * nonStaticMethodInvocation */
| nonStaticMethodInvocation | ::= | ( <FIELD_REFERENCE> | <PERIOD> ) methodName methodCallParameterList |
| | | <PERIOD> methodName |
/* * methodName */
| methodName | ::= | caseSensitiveIdentifierPlusReservedWords |
/* * staticMethodName */
| staticMethodName | ::= | caseSensitiveIdentifierPlusReservedWords |
/* * methodParameter */
| methodParameter | ::= | additiveExpression |
| | | nullSpecification |
/* * primary * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| 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 |
/* * 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> |
| trimType | ::= | <RTRIM> |
| | | <LTRIM> |
/* * valueExpressionPrimary * * @param inSelectClause will be true if this method got called while parsing the select or values clause * If in select or values clause, we do not want to allow boolean values. */
| valueExpressionPrimary | ::= | <LEFT_BRACE> <FN> escapedValueFunction <RIGHT_BRACE> |
| | | <CURRENT> ( <SCHEMA> | <SQLID> ) | |
| | | <CURRENT> <ISOLATION> | |
| | | valueSpecification | |
| | | newInvocation | |
| | | aggregateNode | |
| | | miscBuiltins | |
| | | columnReference | |
| | | <LEFT_PAREN> ( subquery | additiveExpression | valueExpression ) <RIGHT_PAREN> | |
| | | castSpecification |
/* * 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> xmlExistsValue <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 |
/* * xmlExistsValue * * Syntax is as follows: * * XMLEXISTS(PASSING BY VALUE ) * * The result of this operation will be a boolean true/false/unknown value: * -- Unknown if either or is null; * -- True if at least one node in the given xml-value matches the given * XPath expression; * -- False otherwise. * * For example: * * ij> SELECT id FROM x_table WHERE XMLEXISTS('/simple' PASSING BY VALUE xdoc); * ID * ----------- * 1 * */
| xmlExistsValue | ::= | additiveExpression xmlPassingMechanism additiveExpression |
/* * xmlPassingMechanism * * For now, we only support the BY VALUE option because, * at query time, we take the XML string value from disk and * pass it into Xalan, which creates a "copy" of the XML * value internally (as DOM/DTM) and then executes against * that. Because Xalan creates this copy, this impl * is BY VALUE. * */
| xmlPassingMechanism | ::= | <PASSING> <BY> <REF> |
| | | <PASSING> <BY> <VALUE> |
/* * 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 |
| userNode | ::= | <USER> |
| | | <CURRENT_USER> | |
| | | <SESSION_USER> |
/* * newInvocation */
| newInvocation | ::= | <NEW> javaClassName methodCallParameterList |
/* * staticMethodInvocation */
| staticMethodInvocation | ::= | staticMethodName methodCallParameterList |
/** * methodCallParameterList */
| methodCallParameterList | ::= | <LEFT_PAREN> ( methodParameter ( <COMMA> methodParameter )* )? <RIGHT_PAREN> |
/* * routineInvocation */
| routineInvocation | ::= | qualifiedName methodCallParameterList |
/* * 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 )? |
| sortKey | ::= | additiveExpression |
| orderingSpecification | ::= | <ASC> |
| | | <DESC> |
/* * 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 | ::= | additiveExpression |
| | | nullSpecification | |
| | | <_DEFAULT> |
/* * nullSpecification */
| nullSpecification | ::= | <NULL> |
/* * insertColumnsAndSource */
| insertColumnsAndSource | ::= | ( <LEFT_PAREN> insertColumnList <RIGHT_PAREN> )? ( propertyList )? queryExpression |
/* * insertColumnList */
| insertColumnList | ::= | columnQualifiedNameList |
/* * columnQualifiedNameList */
| columnQualifiedNameList | ::= | columnQualifiedNameItem ( <COMMA> columnQualifiedNameItem )* |
/* * columnQualifiedNameItem */
| columnQualifiedNameItem | ::= | columnReference |
/* * rowValueConstructor */
| rowValueConstructor | ::= | <LEFT_PAREN> rowValueConstructorList <RIGHT_PAREN> |
| | | rowValueConstructorElement |
/* * rowValueConstructorElement */
| rowValueConstructorElement | ::= | additiveExpression |
| | | nullSpecification | |
| | | <_DEFAULT> | |
| | |
/* * rowValueConstructorList */
| rowValueConstructorList | ::= | rowValueConstructorElement ( <COMMA> rowValueConstructorElement )* |
/* * tableSubquery */
| tableSubquery | ::= | subquery |
/* * subquery */
| subquery | ::= | queryExpression |
/* * 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 )? |
/* * fromClause */
| fromClause | ::= | <FROM> ( fromListProperties )? dummyTableReferenceRule ( <COMMA> dummyTableReferenceRule )* |
/* * fromListProperties */
| fromListProperties | ::= | propertyList |
/* 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 )? )? |
| optionalTableProperties | ::= | propertyList |
/* * tableReference */
| tableReference | ::= | newInvocation ( <AS> )? identifier ( <LEFT_PAREN> derivedColumnList <RIGHT_PAREN> )? ( optionalTableProperties )? ( joinedTableExpression )* |
| | | qualifiedName optionalTableClauses ( joinedTableExpression )* | |
| | | derivedTable ( <AS> )? identifier ( <LEFT_PAREN> derivedColumnList <RIGHT_PAREN> )? ( optionalTableProperties )? ( joinedTableExpression )* | |
| | | <LEFT_PAREN> tableReferenceTypes <RIGHT_PAREN> ( joinedTableExpression )* |
/* * 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 | ::= | qualifiedJoin |
| qualifiedJoin | ::= | ( joinType )? <JOIN> tableReferenceTypes joinSpecification |
| joinType | ::= | <INNER> |
| | | outerJoinType ( <OUTER> )? |
| outerJoinType | ::= | <LEFT> |
| | | <RIGHT> |
| joinSpecification | ::= | joinCondition |
| joinCondition | ::= | <ON> valueExpression |
/* * 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. */
| aggregateNode | ::= | <COUNT> <LEFT_PAREN> ( <ASTERISK> | aggregateExpression ) <RIGHT_PAREN> |
| | | generalAggregate |
| aggregateExpression | ::= | ( setQuantifier )? additiveExpression |
| generalAggregate | ::= | builtInAggregateType <LEFT_PAREN> aggregateExpression <RIGHT_PAREN> |
| | | identifier <LEFT_PAREN> setQuantifier additiveExpression <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> |
/* * charOrVarchar */
| charOrVarchar | ::= | <CHAR> |
| | | <VARCHAR> |
| castOperand | ::= | additiveExpression |
| | | <NULL> |
/* * dynamicParameterSpecification */
| dynamicParameterSpecification | ::= | <QUESTION_MARK> |
/* * whereClause */
| whereClause | ::= | valueExpression |
| groupByClause | ::= | <GROUP> <BY> groupingColumnReferenceList |
| groupingColumnReferenceList | ::= | groupingColumnReference ( <COMMA> groupingColumnReference )* |
| groupingColumnReference | ::= | columnReference |
| havingClause | ::= | <HAVING> valueExpression |
| schemaDefinition | ::= | <SCHEMA> identifier |
/* * tableDefinition */
| tableDefinition | ::= | <TABLE> qualifiedName tableElementList ( propertyList )? |
| propertyList | ::= | <PROPERTIES> property ( <COMMA> property )* |
| property | ::= | javaDSL <EQUALS_OPERATOR> propertyValue |
| propertyValue | ::= | caseInsensitiveIdentifierPlusReservedWords |
| | | uint_value | |
| | | string |
/* * DB2lockGranularityClause */
| DB2lockGranularityClause | ::= | <LOCKSIZE> lockGranularity |
/* * lockGranularity */
| lockGranularity | ::= | <TABLE> |
| | | <ROW> |
/* * indexDefinition */
| indexDefinition | ::= | ( unique )? <INDEX> qualifiedName <ON> qualifiedName <LEFT_PAREN> indexColumnList <RIGHT_PAREN> ( propertyList )? |
/* * 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> | <EXTERNAL> <NAME> string | <PARAMETER> <STYLE> parameterStyle | <NO> <SQL> | <CONTAINS> <SQL> | <READS> <SQL> <DATA> | <MODIFIES> <SQL> <DATA> | calledOnNullInput ) |
| calledOnNullInput | ::= | ( <CALLED> | <RETURNS> <NULL> ) <ON> <NULL> <INPUT> |
| parameterStyle | ::= | <JAVA> |
| procedureParameterList | ::= | <LEFT_PAREN> ( procedureParameterDefinition ( <COMMA> procedureParameterDefinition )* )? <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> dataTypeCommon ( routineElement )+ |
| functionParameterList | ::= | <LEFT_PAREN> ( functionParameterDefinition ( <COMMA> functionParameterDefinition )* )? <RIGHT_PAREN> |
/* * functionParameterDefinition */
| functionParameterDefinition | ::= | identifier dataTypeDDL |
| viewDefinition | ::= | <VIEW> qualifiedName ( <LEFT_PAREN> viewColumnList <RIGHT_PAREN> )? <AS> queryExpression |
| viewColumnList | ::= | columnNameList |
| triggerDefinition | ::= | <TRIGGER> qualifiedName beforeOrAfter triggerEvent <ON> qualifiedName ( triggerReferencingClause )? <FOR> <EACH> rowOrStatement <MODE> <DB2SQL> 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> | <OLD> | <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> ( <ALWAYS> | <BY> <_DEFAULT> ) <AS> <IDENTITY> ( <LEFT_PAREN> autoIncrementBeginEnd <RIGHT_PAREN> )? |
/* * autoIncrementBeginEnd */
| autoIncrementBeginEnd | ::= | <INCREMENT> <BY> exactNumber |
| | | <START> <WITH> exactNumber ( <COMMA> <INCREMENT> <BY> exactNumber )? |
/* * defaultOption */
| defaultOption | ::= | <NULL> |
| | | DB2DefaultOption |
/* * DB2DefaultOption */
| DB2DefaultOption | ::= | <CURRENT> ( <SCHEMA> | <SQLID> ) |
| | | <USER> | |
| | | miscBuiltins | |
| | | miscBuiltins | |
| | | datetimeValueFunction | |
| | | literal |
/* * literal */
| literal | ::= | ( sign )? numericLiteral |
| | | stringLiteral | |
| | | hexLiteral | |
| | | dateTimeLiteral | |
| | | booleanLiteral |
/* * 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. Cloudscape currently * 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 ) |
/* * renameTableStatement */
| renameTableStatement | ::= | <TABLE> qualifiedName <TO> identifier |
/* * renameIndexStatement */
| renameIndexStatement | ::= | <INDEX> identifier <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 |
| 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> additiveExpression <COMMA> additiveExpression <RIGHT_PAREN> | |
| | | <CASE> whenThenExpression |
/* * caseExpression */
| caseExpression | ::= | <END> |
| | | <ELSE> thenElseExpression <END> | |
| | | whenThenExpression |
/* * whenThenExpression */
| whenThenExpression | ::= | <WHEN> orExpression ( <OR> orExpression )* <THEN> thenElseExpression caseExpression |
/* * thenElseExpression */
| thenElseExpression | ::= | <NULL> |
| | | additiveExpression |
| tableConstraintDefinition | ::= | ( constraintNameDefinition )? tableConstraint ( propertyList )? |
| tableConstraint | ::= | uniqueConstraintDefinition |
| | | referentialConstraintDefinition | |
| | | checkConstraintDefinition |
| 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> ) |
/* * columnConstraintDefinition */
| columnConstraintDefinition | ::= | ( constraintNameDefinition )? columnConstraint |
/* * columnConstraint */
| columnConstraint | ::= | <NOT> <NULL> |
| | | uniqueSpecification ( propertyList )? | |
| | | referencesSpecification ( propertyList )? | |
| | | checkConstraintDefinition |
| dropSchemaStatement | ::= | <SCHEMA> identifier <RESTRICT> |
| alterTableStatement | ::= | <TABLE> qualifiedName alterTableBody |
| alterTableBody | ::= | <COMPRESS> ( <SEQUENTIAL> )? |
| | | alterTableAction |
/*
* alterTableRenameTableStatement
*/
/*
QueryTreeNode
alterTableRenameTableStatement(TableName tableName) throws StandardException :
{
String newTableName;
}
{
newTableName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
{
return (QueryTreeNode) nodeFactory.getNode(
C_NodeTypes.RENAME_NODE,
tableName,
null,
newTableName,
Boolean.TRUE,
ReuseFactory.getInteger(StatementType.RENAME_TABLE),
getContextManager());
}
}
*/
/*
* alterTableRenameColumnStatement
*/
/*
QueryTreeNode
alterTableRenameColumnStatement(TableName tableName) throws StandardException :
{
String oldColumnName;
String newColumnName;
}
{
oldColumnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) newColumnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
{
return (QueryTreeNode) nodeFactory.getNode(
C_NodeTypes.RENAME_NODE,
tableName,
oldColumnName,
newColumnName,
Boolean.TRUE,
ReuseFactory.getInteger(StatementType.RENAME_COLUMN),
getContextManager());
}
}
*/
| alterTableAction | ::= | <ADD> ( addColumnDefinition | tableConstraintDefinition ) |
| | | <ALTER> ( <COLUMN> )? identifier <SET> DB2AlterColumn | |
| | | dropTableConstraintDefinition | |
| | | DB2lockGranularityClause |
| addColumnDefinition | ::= | ( <COLUMN> )? columnDefinition |
| columnAlter | ::= | identifier columnAlterClause |
| columnAlterClause | ::= | defaultClause |
| | | <NULL> | |
| | | <NOT> <NULL> | |
| | | dataTypeDDL |
/* * DB2 syntax for ALTER COLUMN */
| DB2AlterColumn | ::= | <DATA> <TYPE> dataTypeDDL |
| | | <INCREMENT> <BY> exactNumber |
| dropTableConstraintDefinition | ::= | <DROP> <CONSTRAINT> qualifiedName |
| | | <DROP> <PRIMARY> <KEY> | |
| | | <DROP> <FOREIGN> <KEY> qualifiedName | |
| | | <DROP> <UNIQUE> qualifiedName | |
| | | <DROP> <CHECK> qualifiedName |
/* * dropTableStatement */
| dropTableStatement | ::= | <TABLE> qualifiedName |
/* * dropIndexStatement */
| dropIndexStatement | ::= | <INDEX> qualifiedName |
/* * dropAliasStatement */
| dropAliasStatement | ::= | <PROCEDURE> qualifiedName |
| | | <FUNCTION> qualifiedName | |
| | | <SYNONYM> qualifiedName |
| dropViewStatement | ::= | <VIEW> qualifiedName |
| dropTriggerStatement | ::= | <TRIGGER> qualifiedName |
| truncateTableStatement | ::= | <TRUNCATE> <TABLE> qualifiedName |
/* * 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> | <COUNT> | <CREATE> | <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> | <LEFT> | <LIKE> | <LOWER> | <MATCH> | <MAX> | <MIN> | <MINUTE> | <NATIONAL> | <NATURAL> | <NCHAR> | <NVARCHAR> | <NEXT> | <NO> | <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> | <TRANSACTION> | <TRANSLATE> | <TRANSLATION> | <TRUE> | <UNION> | <UNIQUE> | <UNKNOWN> | <UPDATE> | <UPPER> | <USER> | <USING> | <VALUES> | <VARCHAR> | <VARYING> | <VIEW> | <WHENEVER> | <WHERE> | <WITH> | <WORK> | <WRITE> | <YEAR> | <BOOLEAN> | <CALL> | <EXPLAIN> | <LONGINT> | <LTRIM> | <RTRIM> | <SUBSTR> | <XML> | <XMLPARSE> | <XMLSERIALIZE> | <XMLEXISTS> ) |
/* * nonReservedKeyword */
| nonReservedKeyword | ::= | ( <ABS> | <ABSVAL> | <ACTION> | <AFTER> | <ALWAYS> | <BEFORE> | <BINARY> | <BLOB> | <C> | <CALLED> | <CLASS> | <CLOB> | <COALESCE> | <COBOL> | <COMMITTED> | <COMPRESS> | <CONCAT> | <CONTAINS> | <CONTENT> | <CS> | <CURDATE> | <CURTIME> | <D> | <DATA> | <DATE> | <DAY> | <DIRTY> | <DYNAMIC> | <DATABASE> | <DB2SQL> | <DOCUMENT> | <EACH> | <EXCLUSIVE> | <FN> | <FORTRAN> | <GENERATED> | <IDENTITY_VAL_LOCAL> | <INCREMENT> | <INDEX> | <INITIAL> | <INTERVAL> | <JAVA> | <LANGUAGE> | <LARGE> | <LCASE> | <LENGTH> | <LEVEL> | <LOCATE> | <LOCK> | <LOCKS> | <LOCKSIZE> | <LOGGED> | <LONG> | <MESSAGE_LOCALE> | <METHOD> | <MOD> | <MODE> | <MODIFIES> | <MODIFY> | <MODULE> | <MONTH> | <_MORE> | <MUMPS> | <NAME> | <NCLOB> | <NEW> | <NEW_TABLE> | <NULLABLE> | <NUMBER> | <OBJECT> | <OFF> | <OLD> | <OLD_TABLE> | <OJ> | <PASCAL> | <PASSING> | <PLI> | <PRECISION> | <PROPERTIES> | <READS> | <REF> | <RELEASE> | <RENAME> | <REPEATABLE> | <REFERENCING> | <RESET> | <RESULT> | <RETAIN> | <RETURNS> | <ROW> | <RR> | <RS> | <SCALE> | <SAVEPOINT> | <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> | <STRIP> | <SYNONYM> | <STYLE> | <T> | <THEN> | <TIME> | <TIMESTAMP> | <TIMESTAMPADD> | <TIMESTAMPDIFF> | <TRIGGER> | <TRUNCATE> | <TS> | <TYPE> | <UCASE> | <UNCOMMITTED> | <UR> | <USAGE> | <VALUE> | <VARBINARY> | <PARAMETER> | <WHEN> | <WHITESPACE> ) |
/* * caseSensitiveIdentifierPlusReservedWords */
| caseSensitiveIdentifierPlusReservedWords | ::= | caseSensitiveIdentifier |
| | | reservedKeyword |
/* * caseInsensitiveIdentifierPlusReservedWords */
| caseInsensitiveIdentifierPlusReservedWords | ::= | identifier |
| | | reservedKeyword |
/* * caseSensitiveIdentifier */
| caseSensitiveIdentifier | ::= | <IDENTIFIER> |
| | | delimitedIdentifier | |
| | | nonReservedKeyword |