Can anyone help?
The following syntax works against Sybase, Oracle..MSSQL but I'm getting the following error against Teradata.
[NCR] : Syntax error: Invalid TimeStamp Literal.
static String insert_bf_query = "INSERT INTO bf_query " +
"(query_name, source, product, description, sql_text, last_update_date) " +
"VALUES " +
"(?,?,?,?,?,?)";
Date dateNow = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(dateNow);
long millis = cal.getTime().getTime();
System.out.println("millis "+ millis);
try
{
System.out.println("Creating the table"
// stmt.executeUpdate (query1);
stmt.close();
}
catch (SQLException ex)
{
SQLHandler(ex);
}
try
{
PreparedStatement pstmt = con.prepareStatement(insert_bf_query);
pstmt.setString(1, "query_name1"
pstmt.setString(2, "Q"
pstmt.setString(3, "product"
pstmt.setString(4, "description"
pstmt.setString(5, "local_sql_text"
pstmt.setTimestamp(6, new java.sql.Timestamp(millis));
int rows_inserted = pstmt.executeUpdate();
}
The following syntax works against Sybase, Oracle..MSSQL but I'm getting the following error against Teradata.
[NCR] : Syntax error: Invalid TimeStamp Literal.
static String insert_bf_query = "INSERT INTO bf_query " +
"(query_name, source, product, description, sql_text, last_update_date) " +
"VALUES " +
"(?,?,?,?,?,?)";
Date dateNow = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(dateNow);
long millis = cal.getTime().getTime();
System.out.println("millis "+ millis);
try
{
System.out.println("Creating the table"
// stmt.executeUpdate (query1);
stmt.close();
}
catch (SQLException ex)
{
SQLHandler(ex);
}
try
{
PreparedStatement pstmt = con.prepareStatement(insert_bf_query);
pstmt.setString(1, "query_name1"
pstmt.setString(2, "Q"
pstmt.setString(3, "product"
pstmt.setString(4, "description"
pstmt.setString(5, "local_sql_text"
pstmt.setTimestamp(6, new java.sql.Timestamp(millis));
int rows_inserted = pstmt.executeUpdate();
}