[Teradata Database] [TeraJDBC 14.00.00.12] [Error 6760] [SQLState HY000] Invalid timestamp.

Connectivity
Enthusiast

[Teradata Database] [TeraJDBC 14.00.00.12] [Error 6760] [SQLState HY000] Invalid timestamp.

I have a test case where I bind current time (milliseconds) and it fails with [Error 6760] [SQLState HY000] Invalid timestamp. 

My question is do I have to take care of some timestamp formatting before I bind it with setTimestamp method of PreparedStatment ? Or is this a knwon issue and I can expect a solution for it?

Here is the test case details:

a) Teradata Database:  V2R.06.02.02.93

b) Teradata JDBC: 14.00.00.09

c)  Binding in a query:   AND (DA."DAY_DT" BETWEEN ? AND ? )

d) Column definition for DAY_DT:   DAY_DT TIMESTAMP(0)

e)  Java Test Case:

java.sql.Connection conn = null;

java.sql.PreparedStatement ps = null;

java.sql.ResultSet rs = null;

long currTime = (new java.util.Date()).getTime();

try

{

  conn = // getting connection from your Teradata..

  ps = conn.prepareStatement(newSql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY );

  ps.setTimestamp(1, new java.sql.Timestamp(currTime));

  ps.setTimestamp(2, new java.sql.Timestamp(currTime));

  ps.setString(3,"0");

  ps.setString(4,"0");

  ps.setFetchSize(1);

  ps.setMaxRows(1);

  rs = ps.executeQuery();  //<== Error raised in here..

}

catch(Exception ex)

{

  System.out.println(ex);

}

2 REPLIES
Teradata Employee

Re: [Teradata Database] [TeraJDBC 14.00.00.12] [Error 6760] [SQLState HY000] Invalid timestamp.

I just tested binding java.sql.Timestamp values to the question-mark parameter markers in a BETWEEN ? AND ? condition, using Teradata Database V2R06.02.02.67, and it worked successfully.

The Teradata Database Error 6760 "Invalid Timestamp" may be occurring for some other reason.

To troubleshoot further, we would need DDL, sample data, and Teradata JDBC Driver debug logs -- which is too much information for this forum.

If you're a customer, please open an incident with Customer Support, and we can proceed from there.

Thanks,

--Tom

Enthusiast

Re: [Teradata Database] [TeraJDBC 14.00.00.12] [Error 6760] [SQLState HY000] Invalid timestamp.

Thank you Tom.

I will ask the end-user to open an incident with Customer Support.