BNF for sqlgrammar.jj
NON-TERMINALS
/*
* Statement
*/
/*
* StatementPart
*
* @param tokenHolder returns the token that starts
* the statement. If null, ignored.
*/
/*
* spsCreateStatement
*/
/*
* spsDropStatement
*/
/*
* spsAlterStatement
*/
/*
* spsSetStatement
*/
/*
* 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)
*/
/*
* preparableDeleteStatement
*
* This may be a search or positioned delete statement.
*/
/*
* currentOfClause
*/
/*
* 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.
*/
/*
* insertStatement
*/
/*
* preparableUpdateStatement
*/
/*
* callStatement
*/
/*
* baseCallStatement
*/
/*
* 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.
*/
/*
* 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
*/
/*
* LocksOrCursors
*/
/*
* 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
*/
declareTableClause
| declareTableClause |
::= |
( <NOT> <LOGGED> | <ON> <COMMIT> ( onCommit ) <ROWS> | <ON> <ROLLBACK> <DELETE> <ROWS> ) |
/*
* onCommit
*/
onCommit
| onCommit |
::= |
<PRESERVE> |
|
| |
<DELETE> |
/*
* tableElementList
*/
/*
* tableElement
*/
/*
* columnDefinition
*/
/*
* defaultAndConstraints
*/
/*
* dataTypeDDL
*/
/**
Returns a dataTypeDDL() as a catalog type, ie.
the Java interface TypeDescriptor.
*/
/*
* dataTypeCast
*/
/*
* dataTypeCommon
*/
/*
* characterStringType
*/
/*
* charOrCharacter
*/
/*
* charType
*/
/*
** forBitData
*/
/*
* nationalCharacterStringType
*/
/*
* lobType
*/
/*
* numericType
*/
/*
* exactNumericType
*/
/*
* exactNumericType
*/
exactIntegerType
| exactIntegerType |
::= |
( <INTEGER> | <INT> ) |
|
| |
<SMALLINT> |
|
| |
<LONGINT> |
/*
* approximateNumericType
*/
/*
* doubleType
*/
doubleType
| doubleType |
::= |
( <DOUBLE> <PRECISION> | <DOUBLE> ) |
/*
* longType
*/
/*
* XMLType
*/
/*
* xmlDocOrContent
*
* Parse the XML keywords DOCUMENT and CONTENT. We don't
* support CONTENT yet, so we throw an appropriate error
* if we see it.
*
*/
/*
* javaType
*/
/*
* javaDSL
*
* A Java dot-separated list.
*/
/*
* javaClassName
*/
/*
* javaDSLNameExtender
*/
/*
* lengthAndModifier
*/
lengthAndModifier
| lengthAndModifier |
::= |
<LEFT_PAREN> ( <LENGTH_MODIFIER> | <EXACT_NUMERIC> ( <IDENTIFIER> )? ) <RIGHT_PAREN> |
/*
* length
*/
length
| length |
::= |
<EXACT_NUMERIC> |
/*
* exactNumber
*/
/*
* precision
*/
/*
* uint_value
*/
/*
* scale
*/
/*
* datetimeType
*/
/*
* timePrecision
*/
/*
* qualifiedName
*/
/*
* 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.
*/
/*
* unionOrExcept
*/
/*
* 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.
*/
/*
* intersect
*/
/*
* nonJoinQueryPrimary
*/
/*
* simpleTable
*/
/*
* querySpecification
*/
/*
* setQuantifier
*/
/*
* selectList
*/
/*
* selectSublist
*/
/*
* derivedColumn
*/
/*
* asClause
*/
/*
* 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.
*/
/*
* 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.
*/
/*
* 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.
*/
/*
* 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.
*/
/*
* 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.
*/
/*
* 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.
*/
/*
* 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.
*/
/*
* 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.
*/
/*
* 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.
*/
/*
* compOp
*/
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.
*/
/*
* additiveOperator
*/
/*
* 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.
*/
/*
* multiplicativeOperator
*/
/*
* 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.
*/
/*
* sign
*/
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.
*/
/*
* nonStaticMethodInvocation
*/
/*
* methodName
*/
/*
* staticMethodName
*/
/*
* methodParameter
*/
/*
* 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.
*/
/*
* staticClassReference
*/
/*
* staticClassReferenceType
*/
/*
* staticClassFieldReference
*/
/*
* nonSecondDatetimeField
*/
/*
* numericValueFunction
*/
/*
* timestampArithmeticFuncion
*/
/*
* jdbcIntervalType
*/
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
*/
/*
* coalesceFunction
*/
/*
* coalesceExpression
*/
/*
* absFunction
*/
/*
* modFunction
*/
/*
* datetimeField
*/
ansiTrimSpec
| ansiTrimSpec |
::= |
<TRAILING> |
|
| |
<LEADING> |
|
| |
<BOTH> |
/*
* 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.
*/
/*
* miscBuiltins
*/
/*
* dataTypeScalarFunction
*/
/*
* xmlFunction
*
* This method parses the built-in functions used with
* the XML datatype.
*
*/
/*
* xmlParseValue
*
* Syntax is as follows:
*
* XMLPARSE( DOCUMENT PRESERVE 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.
*
*/
/*
* xmlPreserveWhitespace
*
* For now, we only support the PRESERVE WHITESPACE option.
*
*/
/*
* 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
*
*/
/*
* xmlSerializeTargetType
*
* Parse the target type of an XMLSERIALIZE operation.
*
*/
/*
* 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
*
*/
/**
* 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.
*/
/**
* 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).
*/
/*
* 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.
*/
/*
* 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
| 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.
*/
/*
* numericFunctionType
*/
/*
* dateTimeScalarFunction
*/
/*
* timestampFunctionCompletion
*/
/*
* booleanLiteral
*/
/*
* generalValueSpecification
*/
userNode
| userNode |
::= |
<USER> |
|
| |
<CURRENT_USER> |
|
| |
<SESSION_USER> |
/*
* currentRoleNode
*/
/*
* newInvocation
*/
/*
* 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.
*/
/*
* staticMethodInvocation
*/
/**
* methodCallParameterList
*/
/*
* routineInvocation
*/
/*
* javaClass
*/
/*
* columnMethodInvocation
*/
/*
* columnNameForInvocation
*/
/*
* columnReference
*/
/*
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.
**
[ |
[ [ [ ] ] ]
]
}
*/
/*
* 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
| nullOrdering |
::= |
<NULLS> <LAST> |
|
| |
<NULLS> <FIRST> |
/*
* offsetClause
*/
/*
* fetchFirstClause
*/
/*
* forUpdateClause
*/
/*
* forUpdateColumnList
*/
/*
* forUpdateColumn
*/
/*
* setClauseList
*/
/*
* setClause
*/
/*
* updateSource
*/
/*
* nullSpecification
*/
/*
* insertColumnsAndSource
*/
/*
* insertColumnList
*/
/*
* columnQualifiedNameList
*/
/*
* columnQualifiedNameItem
*/
/*
* rowValueConstructor
*/
/*
* rowValueConstructorElement
*/
/*
* rowValueConstructorList
*/
/*
* tableSubquery
*/
/*
* subquery
*/
/*
* inPredicateValue
*/
/*
* inValueList
*/
/*
* inElement
*/
/*
* quantifier
*/
/*
* some
*/
some
| some |
::= |
<SOME> |
|
| |
<ANY> |
/*
* existsExpression
*/
/*
* tableExpression
*/
/*
* fromClause
*/
/*
* fromListProperties
*/
/* This rule created simply as a way to add the result of tableReference()
* to the fromList.
*/
/*
* tableReference
*/
/*
* derivedColumnList
*/
/*
* columnNameList
*/
/*
* columnNameItem
*/
/*
* indexColumnList
*/
/*
* indexColumnItem
*/
/*
* derivedTable
*/
/*
* tableValueConstructor
*/
/*
* tableValueConstructorList
*/
/*
* explicitTable
*/
/*
* datetimeValueFunction
*/
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.
*/
/*
** 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().
*/
/*
* charOrVarchar
*/
/*
* dynamicParameterSpecification
*/
/*
* whereClause
*/
/*
* roleDefinition
*/
/*
* sequenceDefinition
*/
/*
* dropSequenceStatement
*/
/*
* tableDefinition
*/
/*
* This method is called when a comment starting with --derby-properties is found.
* Such a comment is a special directive to Derby and allows a sql 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.
* The param propertiesUseAllowed true 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 eg impl/load/import.java specifies property insertMode=replace/bulkInsert
* in the insert statement. This same property will not be acceptable from an
* insert statement from a user sql.
*/
/*
* DB2lockGranularityClause
*/
/*
* lockGranularity
*/
/*
* indexDefinition
*/
/*
* 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)
*/
calledOnNullInput
| calledOnNullInput |
::= |
( <CALLED> | <RETURNS> <NULL> ) <ON> <NULL> <INPUT> |
/*
* procedureParameterDefinition
*/
/**
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
*/
/*
* functionParameterDefinition
*/
/*
* functionReturnDataType
*/
/*
* functionTableType
*/
/*
* functionTableReturnColumn
*/
/**
CREATE TYPE
*/
beforeOrAfter
| beforeOrAfter |
::= |
<NO> <CASCADE> <BEFORE> |
|
| |
<AFTER> |
/*
* defaultClause
*/
/*
* defaultNullOnlyClause
*/
/*
* generatedColumnOption
*/
//ToCleanUp
//A specific class not such long[] should exists for autoIncrementInfo ...
/*
* generatedAlways
*/
/*
* generatedByDefault
*/
/*
* asIdentity
*/
/*
* generationClause
*/
/*
* autoIncrementBeginEnd
*/
/*
* defaultOption
*/
/*
* DB2DefaultOption
*/
/*
* literal
*/
/*
* intLiteral
*/
/*
* numericLiteral
*/
numericLiteral
| numericLiteral |
::= |
<EXACT_NUMERIC> |
|
| |
<APPROXIMATE_NUMERIC> |
/*
* dateTimeLiteral
*/
/*
* escapedDateTimeLiteral
*/
/*
* bareDateLiteral
*/
/*
* bareTimeLiteral
*/
/*
* bareTimestampLiteral
*/
/*
* string
*/
/*
* stringLiteral
*/
/*
* hexLiteral
*/
/*
* 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.
*/
/*
* spsRenameStatement
*/
/*
* renameTableStatement
*/
/*
* renameIndexStatement
*/
lockMode
| lockMode |
::= |
<EXCLUSIVE> |
|
| |
<SHARE> |
levelOfIsolation
| levelOfIsolation |
::= |
<READ> |
|
| |
<REPEATABLE> <READ> |
|
| |
<SERIALIZABLE> |
/*
* simpleValueSpecification
*/
/*
* setRoleStatement
*/
/*
* setRoleSpecification
*/
setSchemaHeader
| setSchemaHeader |
::= |
<SCHEMA> |
|
| |
<CURRENT> ( <SCHEMA> | <SQLID> ) |
// 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
/*
* valueSpecification
*/
/*
* caseExpression
*/
/*
* whenThenExpression
*/
/*
* thenElseExpression
*/
//the second parameter to the following method will always be null for a table level
//constraint but not for a column level constraint
deleteReferentialAction
| deleteReferentialAction |
::= |
<CASCADE> |
|
| |
<RESTRICT> |
|
| |
<NO> <ACTION> |
|
| |
<SET> ( <NULL> | <_DEFAULT> ) |
/*
* columnConstraintDefinition
*/
/*
* columnConstraint
*/
/*
* dropRoleStatement
*/
inplaceCompress
| inplaceCompress |
::= |
<INPLACE> ( ( <PURGE> )? ( <DEFRAGMENT> )? ( <TRUNCATE_END> )? ) |
/*
* alterTableRenameTableStatement
*/
/*
StatementNode
alterTableRenameTableStatement(TableName tableName) throws StandardException :
{
String newTableName;
}
{
newTableName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
{
return (StatementNode) nodeFactory.getNode(
C_NodeTypes.RENAME_NODE,
tableName,
null,
newTableName,
Boolean.TRUE,
ReuseFactory.getInteger(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 (StatementNode) nodeFactory.getNode(
C_NodeTypes.RENAME_NODE,
tableName,
oldColumnName,
newColumnName,
Boolean.TRUE,
ReuseFactory.getInteger(StatementType.RENAME_COLUMN),
getContextManager());
}
}
*/
/*
* Handle
*
* ALTER TABLE tablename DROP [ COLUMN ] columnname [ CASCADE | RESTRICT ]
*/
/*
* Various variants of the ALTER TABLE ALTER COLUMN statement.
*
* By the type 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
* [NOT] NULL
*/
/*
* dropTableStatement
*/
/*
* dropIndexStatement
*/
/*
* dropAliasStatement
*/
/*
* grantStatement
*/
/*
* tableGrantStatement
*/
// end of tableGrantStatement
/*
* tablePrivileges
*/
// end of tablePrivilege
/*
* tableActions
*/
// end of tableActions
/*
* routineGrantStatement
*/
// end of routineGrantStatement
/*
* routineAlias
*/
// end of routineDesignator
/*
* parameterTypeList
*/
// end of parameterTypeList
/*
* tableAction
*/
// end of tableAction
/*
* privilegeColumnList
*/
// end of privilegeColumnList
/*
* granteeList
*/
/*
* roleGrantStatement
*/
/*
* roleList
*/
/*
* roleElement
*/
/*
* revokeStatement
*/
/*
* tableRevokeStatement
*/
// end of tableRevokeStatement
/*
* routineRevokeStatement
*/
// end of routineRevokeStatement
/*
* roleRevokeStatement
*/
/*
* identifier
*/
/*
* delimitedIdentifier
*/
/*
* reservedKeyword
*/
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> | <LONGINT> | <LTRIM> | <RTRIM> | <TRIM> | <SUBSTR> | <XML> | <XMLPARSE> | <XMLSERIALIZE> | <XMLEXISTS> | <XMLQUERY> ) |
/*
* nonReservedKeyword
*/
nonReservedKeyword
| nonReservedKeyword |
::= |
( <ABS> | <ABSVAL> | <ACTION> | <AFTER> | <ALWAYS> | <BEFORE> | <BINARY> | <BLOB> | <C> | <CALLED> | <CLASS> | <CLOB> | <COALESCE> | <COBOL> | <COMMITTED> | <COMPRESS> | <CONCAT> | <CONTAINS> | <CONTENT> | <COUNT> | <CS> | <CURDATE> | <CURTIME> | <D> | <DATA> | <DATE> | <DAY> | <DEFRAGMENT> | <DIRTY> | <DYNAMIC> | <DATABASE> | <DB2SQL> | <DERBY_JDBC_RESULT_SET> | <DOCUMENT> | <EACH> | <EMPTY> | <EXCLUSIVE> | <FN> | <FORTRAN> | <GENERATED> | <IDENTITY_VAL_LOCAL> | <INCREMENT> | <INDEX> | <INITIAL> | <INPLACE> | <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> | <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
*/
/*
* caseInsensitiveIdentifierPlusReservedWords
*/
/*
* caseSensitiveIdentifier
*/