Quote:
Originally posted by Marcus_A
I don't know much about Java, but any date that is used in a SQL statement (unless referenced directly as a DB2 table column) must be in character string format of length 10. The internal representation of date stored in DB2 is 4 bytes (2 numeric digits per byte), but you cannot access it that way in a SQL statement.
|
1)
If my SQL is
VARCHAR(S0.MOD_DATA_COMPILAZIONE) >= CAST(? as VARCHAR(10))
and my JAVA executes
pst.setString(1,'01-01-2001')
I have this error
CLI0112E Errore nell'assegnazione. SQLSTATE=22005
2)
If my SQL is
VARCHAR(S0.MOD_DATA_COMPILAZIONE) >= CAST(? as VARCHAR(10))
and my JAVA executes
pst.setDate(1, new java.sql.Date(System.currentTimemillis() ))
I have this error
CLI0102E Conversione non valida. SQLSTATE=07006
3)
If my SQL is
VARCHAR(S0.MOD_DATA_COMPILAZIONE) >= CAST(? as DATE)
and my JAVA executes
pst.setDate(1, new java.sql.Date(System.currentTimemillis() ))
I have this error
CLI0102E Conversione non valida. SQLSTATE=07006
4)
If my SQL is
VARCHAR(S0.MOD_DATA_COMPILAZIONE) >= CAST(? as DATE)
and my JAVA executes
pst.setString(1,'01-01-2001')
I have this error
CLI0102E Conversione non valida. SQLSTATE=07006
5)
If my SQL is
S0.MOD_DATA_COMPILAZIONE) >= CAST(? as DATE)
and my JAVA executes
pst.setString(1,'01-01-2001')
I have this error
CLI0102E Conversione non valida. SQLSTATE=07006
6)
If my SQL is
S0.MOD_DATA_COMPILAZIONE) >= CAST(? as DATE)
and my JAVA executes
pst.setDate(1, new java.sql.Date(System.currentTimemillis() ))
I have this error
CLI0102E Conversione non valida. SQLSTATE=07006