Prev: Gosling has left Oracle
Next: file loading
From: moongeegee on 11 Apr 2010 22:06 I use Oracle 10.0.2.0.1 I need to retrieve a data ( ex: 2010-01-05 11:10:50.110) from a table the column is mydate, the datatype is Date. I use the data insert into another table; the datatype is date also. sqlstmt.setTimestamp(1,res.getTimestamp("mydate"); I got an error as ORA-01847: day of month must be between 1 and last day of month. Please help.
From: Lothar Kimmeringer on 12 Apr 2010 11:43 moongeegee wrote: > sqlstmt.setTimestamp(1,res.getTimestamp("mydate"); > I got an error as ORA-01847: day of month must be between 1 and last > day of month. > > Please help. What is the value of res.getTimestamp("mydate")? Regards, Lothar -- Lothar Kimmeringer E-Mail: spamfang(a)kimmeringer.de PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81) Always remember: The answer is forty-two, there can only be wrong questions!
From: Lew on 12 Apr 2010 14:56 moongeegee wrote: >> sqlstmt.setTimestamp(1,res.getTimestamp("mydate"); This line will not compile due to a missing parenthesis. >> I got an error as ORA-01847: day of month must be between 1 and last >> day of month. > This is a far distance from an SSCCE. <http://sscce.org/> The problems most likely, rather, nearly certainly lie in the code you have not shown us. Lothar Kimmeringer wrote: > What is the value of res.getTimestamp("mydate")? > That is the crucial question. Other important questions: What is the query string for 'sqlstmt'? (Side note: Follow the naming conventions.) What is the query string for which 'res' is (presumably) the 'ResultSet'? Was that 'ResultSet' generated from the same 'Statement' instance pointed to by 'sqlstmt'? java.sql.Timestamp is not the Java type that corresponds to "DATE", although I don't think that mistake would raise the error that you see. Just for grins, what happens if you use the correct type (java.sql.Date)? -- Lew
|
Pages: 1 Prev: Gosling has left Oracle Next: file loading |