Exception in thread "main" COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/6000] SQL0423N Locator variable "1" does not currently represent any value. SQLSTATE=0F001
I am sporatically getting the above error and don't know how to determine the problem. From the message text, I know what it is, but it only happens occasionally. Process with regards to the LOB is always the same, so I would expect that the problem would occur all the time if it was a coding problem.
Here is the code that seems to be causing the problem:
try {
// Create a result set containing all data from my_table
Statement stmt2 = con_cs.createStatement();
rs2 =
stmt2.executeQuery(
"select table_name, validation_detail from ezk100c.data_validation "
+ "where run_date = (select max(run_date) from ezk100c.data_validation)"
;
}
catch (SQLException e) {
System.out.println(e);
}
outputLogFile.newLine();
outputLogFile.newLine();
outputLogFile.newLine();
outputLogFile.write(
" ******** Sampled Data Validation Detail Report ******** "
;
outputLogFile.newLine();
outputLogFile.write(" ******** " + runDateTime + " ******** "
;
outputLogFile.newLine();
outputLogFile.newLine();
outputLogFile.newLine();
while (rs2.next()) {
Clob errorComment = rs2.getClob(2);
// ************ this requires a higher level of java on unix AND java12
long clobLength = errorComment.length();
if (clobLength > 0) {
outputLogFile.write(
"For Table "
+ rs2.getString(1)
+ " the following inconsistencies were encountered"
;
outputLogFile.newLine();
outputLogFile.newLine();
outputLogFile.write(rs2.getString(2));
outputLogFile.newLine();
Paul
I am sporatically getting the above error and don't know how to determine the problem. From the message text, I know what it is, but it only happens occasionally. Process with regards to the LOB is always the same, so I would expect that the problem would occur all the time if it was a coding problem.
Here is the code that seems to be causing the problem:
try {
// Create a result set containing all data from my_table
Statement stmt2 = con_cs.createStatement();
rs2 =
stmt2.executeQuery(
"select table_name, validation_detail from ezk100c.data_validation "
+ "where run_date = (select max(run_date) from ezk100c.data_validation)"
}
catch (SQLException e) {
System.out.println(e);
}
outputLogFile.newLine();
outputLogFile.newLine();
outputLogFile.newLine();
outputLogFile.write(
" ******** Sampled Data Validation Detail Report ******** "
outputLogFile.newLine();
outputLogFile.write(" ******** " + runDateTime + " ******** "
outputLogFile.newLine();
outputLogFile.newLine();
outputLogFile.newLine();
while (rs2.next()) {
Clob errorComment = rs2.getClob(2);
// ************ this requires a higher level of java on unix AND java12
long clobLength = errorComment.length();
if (clobLength > 0) {
outputLogFile.write(
"For Table "
+ rs2.getString(1)
+ " the following inconsistencies were encountered"
outputLogFile.newLine();
outputLogFile.newLine();
outputLogFile.write(rs2.getString(2));
outputLogFile.newLine();
Paul