push null test into each type

This commit is contained in:
Paul Trowbridge 2022-10-25 13:24:15 -04:00
parent e60a92cfdc
commit cf5abeddbe
1 changed files with 64 additions and 47 deletions

View File

@ -199,54 +199,71 @@ public class jrunner {
t++;
nr = "";
for (int i = 1; i <= cols; i++){
nc = rs.getString(i);
if (nc == null) {
nc = "NULL";
}
else {
if (rs.wasNull()) {
nc = "NULL";
} else {
switch (dtn[i]){
case "VARCHAR":
nc = rs.getString(i).replace("'","''");
if (trim) { nc = nc.trim();}
nc = "'" + nc + "'";
break;
case "CLOB":
nc = rs.getString(i).replace("'","''");
if (trim) { nc = nc.trim();}
nc = "'" + nc + "'";
break;
case "CHAR":
nc = rs.getString(i).replace("'","''");
if (trim) { nc = nc.trim();}
nc = "'" + nc + "'";
break;
case "DATE":
nc = "'" + rs.getString(i) + "'";
if (nc == "'1/1/0001 12:00:00 AM'") {
nc = "NULL";
}
break;
case "TIME":
nc = "'" + rs.getString(i).replace("'","''") + "'";
break;
case "TIMESTAMP":
nc = "'" + rs.getString(i).replace("'","''") + "'";
break;
case "BIGINT":
nc = rs.getString(i);
default:
if (rs.getString(i) != "") {
nc = rs.getString(i);
}
else {
nc = "NULL";
}
break;
switch (dtn[i]){
case "VARCHAR":
nc = rs.getString(i).replace("'","''");
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
}
if (trim) { nc = nc.trim();}
nc = "'" + nc + "'";
break;
case "CLOB":
nc = rs.getString(i).replace("'","''");
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
if (trim) { nc = nc.trim();}
nc = "'" + nc + "'";
break;
case "CHAR":
nc = rs.getString(i).replace("'","''");
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
if (trim) { nc = nc.trim();}
nc = "'" + nc + "'";
break;
case "DATE":
nc = "'" + rs.getString(i) + "'";
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
if (nc == "'1/1/0001 12:00:00 AM'") {
nc = "NULL";
}
break;
case "TIME":
nc = "'" + rs.getString(i).replace("'","''") + "'";
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
break;
case "TIMESTAMP":
nc = "'" + rs.getString(i).replace("'","''") + "'";
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
break;
case "BIGINT":
nc = rs.getString(i);
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
default:
nc = rs.getString(i);
if (rs.wasNull() || nc == null) {
nc = "NULL";
break;
}
break;
}
if (i != 1){
nr = nr + ",";