Using JDBC 'ts' (timestamp) in an insert statement on 9i JDBC driver
305953Dec 3 2002 — edited Mar 27 2003Hi All,
I came across this error... and was wondering if anyone has seen this.. OR if it is a know issue/bug.
java.sql.SQLException: ORA-00904: invalid column name
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java, Compiled Code)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java, Compiled Code)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java, Compiled Code)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java, Compiled Code)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java, Compiled Code)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java, Compiled Code)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java, Compiled Code)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java, Compiled Code)
While running some inserts against a table for a date field I get the above exception. Here's the insert statement:
insert into foo ( bar ) values ({ts '2002-10-30 22:23:24.0'})
Now 'bar' is of type 'date'
The format you see above is the standard format mentioned in the JDBC spec:
http://java.sun.com/products/jdk/1.2/docs/guide/jdbc/spec/jdbc-spec.frame11.html
This used to work with the earlier drivers.. 816 awa 817.. but not with 9i. Has this changed?
Are we not supposed to use 'ts' for date fields nomore? Is that it? Is the new oracle jdbc driver more type 'checking'? Does anyone know more?
Thanks in advance.
Pramod