3 Replies Latest reply: Dec 13, 2007 10:04 PM by Shiyer-Oracle RSS

    Error number: 1866, ORA-01866: the datetime class is invalid

    489932
      Hi, could anyone please help me out with the following error:

      I got the Error number: 1866, ORA-01866: the datetime class is invalid when i ran the following code:

      string sqlStmt = "SELECT Task.TaskId,TaskDefinition.Command,Task.State,TaskDefinition.Priority,TaskDefi
      nition.Workload,Task.ProcessId,Task.StartTime,Task.EndTime,Task.ReturnCode,TaskDefinition.MaxCpuTime,Task.I
      nformation FROM Task,TaskDefinition WHERE (Task.BatchId =:x OR Task.BatchId = -1) AND Task.State =:y AND Ta
      sk.TaskId = TaskDefinition.TaskId ORDER BY Task.TaskId,Task.StartTime";

      Statement *stmt = conn->createStatement(sqlStmt);
      stmt->setInt(1,batch);
      stmt->setString(2, cState);

      ResultSet *rs = stmt->executeQuery();
      try {
      while (rs->next()){
      failTask.TaskId = rs->getInt(1);
      failTask.Command = rs->getString(2);
      failTask.State = rs->getString(3);
      failTask.Priority = rs->getInt(4);
      failTask.Workload = rs->getInt(5);
      failTask.ProcessId = rs->getInt(6);
      failTask.StartTime = rs->getTimestamp(7);
      failTask.EndTime = rs->getTimestamp(8);
      failTask.ReturnCode = rs->getInt(9);
      failTask.MaxCpuTime = rs->getInt(10);
      failTask.Information= rs->getString(11);

      TaskList.push_back(failTask);
      }
      }catch(SQLException ex)
      {
      cout<<"Exception thrown for displayRow in viewmode -1"<<endl;
      cout<<"Error number: "<< ex.getErrorCode() <<", ";
      cout<<ex.getMessage() << endl;
      }

      Thanks.