improved oracle pl/sql parser.

This commit is contained in:
wenshao
2017-05-13 05:03:10 +08:00
parent b6a15a3c23
commit 33914b35df
10 changed files with 364 additions and 35 deletions
@@ -3353,8 +3353,10 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
if (JdbcConstants.ORACLE.equals(dbType)) {
String dataTypeName = dataType.getName();
if ((dataTypeName.endsWith("%TYPE") && x.getDefaultValue() == null)
|| dataTypeName.equalsIgnoreCase("REF CURSOR")) {
boolean printType = (dataTypeName.startsWith("TABLE OF") && x.getDefaultValue() == null)
|| dataTypeName.equalsIgnoreCase("REF CURSOR")
|| dataTypeName.startsWith("VARRAY(");
if (printType) {
print0(ucase ? "TYPE " : "type ");
}
@@ -3372,6 +3374,10 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
if (x.isNoCopy()) {
print0(ucase ? "NOCOPY " : "nocopy ");
}
if (printType) {
print0(ucase ? "IS " : "is ");
}
} else {
if (x.getParamType() == SQLParameter.ParameterType.IN) {
print0(ucase ? "IN " : "in ");