improved oracle sql parser. issue #1400

This commit is contained in:
wenshao
2016-09-11 23:24:49 +08:00
parent d069606a9e
commit d66fcf737e
5 changed files with 123 additions and 58 deletions
@@ -54,7 +54,23 @@ public class SQLDeleteStatement extends SQLStatementImpl {
}
public SQLName getTableName() {
return (SQLName) getExprTableSource().getExpr();
if (this.tableSource instanceof SQLExprTableSource) {
SQLExprTableSource exprTableSource = (SQLExprTableSource) this.tableSource;
return (SQLName) exprTableSource.getExpr();
}
if (tableSource instanceof SQLSubqueryTableSource) {
SQLSelectQuery selectQuery = ((SQLSubqueryTableSource) tableSource).getSelect().getQuery();
if (selectQuery instanceof SQLSelectQueryBlock) {
SQLTableSource subQueryTableSource = ((SQLSelectQueryBlock) selectQuery).getFrom();
if (subQueryTableSource instanceof SQLExprTableSource) {
SQLExpr subQueryTableSourceExpr = ((SQLExprTableSource) subQueryTableSource).getExpr();
return (SQLName) subQueryTableSourceExpr;
}
}
}
return null;
}
public void setTableName(SQLName tableName) {