Michael Lupp wrote :

>I have the following table:

>CREATE TABLE EPK_TBL(ID INTEGER NOT NULL, STATE INTEGER NOT NULL, TIMESTAMP
INTEGER NOT NULL) ;

>and I have the following statement:

>SELECT STATE,TIMESTAMP FROM TEST_TBL WHERE ID=1;

>I think this should work, but when I try to read the TIMESTAMP value out of
the result set, I get this error:

>com.sap.dbtech.jdbc.translators.ConversionExceptionSapDB
>Cannot convert SQL TIMESTAMP to Java long

>com.sap.dbtech.jdbc.translators.ConversionExceptionSapDB: Cannot convert
SQL TIMESTAMP to Java long
>       at
com.sap.dbtech.jdbc.translators.DBTechTranslator.newGetException(DBTechTrans
lator.java:1096)
>       at
com.sap.dbtech.jdbc.translators.DBTechTranslator.getLong(DBTechTranslator.ja
va:566)
>       at
com.sap.dbtech.jdbc.ResultSetSapDB.getLong(ResultSetSapDB.java:1043)


>I think this is an error in the JDBC driver, or do I something wrong?

Unfortunately you called a column of the table like a SAPDB function :
TIMESTAMP.
Therefore in your <select statement> you don't select your column but call
the function
TIMESTAMP instead. You have to specify the column as an special identifier,
i.e.

SELECT STATE,"TIMESTAMP" FROM TEST_TBL WHERE ID=1

Thomas

---

Thomas Anhaus
SAPDB, SAP Labs Berlin 


_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to