use of com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUsingIndexClause in project druid by alibaba.
the class OracleExprParser method parsePrimaryKey.
public OraclePrimaryKey parsePrimaryKey() {
lexer.nextToken();
accept(Token.KEY);
OraclePrimaryKey primaryKey = new OraclePrimaryKey();
accept(Token.LPAREN);
exprList(primaryKey.getColumns(), primaryKey);
accept(Token.RPAREN);
if (lexer.token() == Token.USING) {
OracleUsingIndexClause using = parseUsingIndex();
primaryKey.setUsing(using);
}
return primaryKey;
}
use of com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUsingIndexClause in project druid by alibaba.
the class OracleExprParser method parseUsingIndex.
private OracleUsingIndexClause parseUsingIndex() {
accept(Token.USING);
accept(Token.INDEX);
OracleUsingIndexClause using = new OracleUsingIndexClause();
for (; ; ) {
if (lexer.token() == Token.TABLESPACE) {
lexer.nextToken();
using.setTablespace(this.name());
continue;
} else if (lexer.token() == Token.PCTFREE) {
lexer.nextToken();
using.setPtcfree(this.expr());
continue;
} else if (lexer.token() == Token.INITRANS) {
lexer.nextToken();
using.setInitrans(this.expr());
continue;
} else if (lexer.token() == Token.MAXTRANS) {
lexer.nextToken();
using.setMaxtrans(this.expr());
continue;
} else if (lexer.token() == Token.COMPUTE) {
lexer.nextToken();
acceptIdentifier("STATISTICS");
using.setComputeStatistics(true);
continue;
} else if (lexer.token() == Token.ENABLE) {
lexer.nextToken();
using.setEnable(true);
continue;
} else if (lexer.token() == Token.DISABLE) {
lexer.nextToken();
using.setEnable(false);
continue;
} else if (lexer.token() == Token.STORAGE) {
OracleStorageClause storage = parseStorage();
using.setStorage(storage);
continue;
} else if (lexer.token() == Token.IDENTIFIER) {
using.setTablespace(this.name());
break;
} else {
break;
}
}
return using;
}
use of com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUsingIndexClause in project druid by alibaba.
the class OracleExprParser method parseUnique.
public SQLUnique parseUnique() {
accept(Token.UNIQUE);
OracleUnique unique = new OracleUnique();
accept(Token.LPAREN);
exprList(unique.getColumns(), unique);
accept(Token.RPAREN);
if (lexer.token() == Token.USING) {
OracleUsingIndexClause using = parseUsingIndex();
unique.setUsing(using);
}
return unique;
}
Aggregations