char lockGranularity = TableDescriptor.DEFAULT_LOCK_GRANULARITY;
Properties properties = null;
TableName tableName;
TableElementList tableElementList;
ResultColumnList resultColumns = null;
ResultSetNode queryExpression;
boolean withData = true;
jj_consume_token(TABLE);
tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
if (getToken(1).kind == LEFT_PAREN &&
getToken(3).kind != COMMA &&
getToken(3).kind != RIGHT_PAREN) {
tableElementList = tableElementList();
switch (jj_nt.kind) {
case DERBYDASHPROPERTIES:
properties = propertyList(false);
jj_consume_token(CHECK_PROPERTIES);
break;
default:
jj_la1[209] = jj_gen;
;
}
{if (true) return (StatementNode) nodeFactory.getNode(
C_NodeTypes.CREATE_TABLE_NODE,
tableName,
tableElementList,
properties,
new Character(lockGranularity),
getContextManager());}
} else {
switch (jj_nt.kind) {
case AS:
case LEFT_PAREN:
switch (jj_nt.kind) {
case LEFT_PAREN:
jj_consume_token(LEFT_PAREN);
resultColumns = tableColumnList();
jj_consume_token(RIGHT_PAREN);
break;
default:
jj_la1[210] = jj_gen;
;
}
jj_consume_token(AS);
queryExpression = queryExpression(null, NO_SET_OP);
jj_consume_token(WITH);
switch (jj_nt.kind) {
case NO:
jj_consume_token(NO);
withData = false;
break;
default:
jj_la1[211] = jj_gen;
;
}
jj_consume_token(DATA);
// Raise error if WITH DATA is specified
// (until it is implemented)
if (withData) {
{if (true) throw StandardException.newException(
SQLState.NOT_IMPLEMENTED, "WITH DATA");}
}
/* Parameters not allowed in create table */
HasNodeVisitor visitor =
new HasNodeVisitor(ParameterNode.class);
queryExpression.accept(visitor);
if (visitor.hasNode())
{
{if (true) throw StandardException.newException(
SQLState.LANG_NO_PARAMS_IN_TABLES);}
}