improved oracle pl/sql parser.

This commit is contained in:
wenshao
2017-05-12 14:57:54 +08:00
parent b70bbb2add
commit 653da5e545
3 changed files with 138 additions and 7 deletions
@@ -3349,7 +3349,15 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
decrementIndent();
} else {
SQLDataType dataType = x.getDataType();
if (JdbcConstants.ORACLE.equals(dbType)) {
String dataTypeName = dataType.getName();
if ((dataTypeName.endsWith("%TYPE") && x.getDefaultValue() == null)
|| dataTypeName.equalsIgnoreCase("REF CURSOR")) {
print0(ucase ? "TYPE " : "type ");
}
x.getName().accept(this);
if (x.getParamType() == SQLParameter.ParameterType.IN) {
print0(ucase ? " IN " : " in ");
@@ -3376,7 +3384,7 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
print(' ');
}
x.getDataType().accept(this);
dataType.accept(this);
if (x.getDefaultValue() != null) {
print0(" := ");