db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marl Atkins" <m...@softlinksys.com>
Subject RE: Date - Timestamp format for inserts?
Date Sun, 19 Nov 2006 21:15:58 GMT
Yep, that did it. Thanks.
 

-----Original Message-----
From: Bryan Pendleton [mailto:bpendleton@amberpoint.com] 
Sent: Sunday, November 19, 2006 2:53 PM
To: Derby Discussion
Subject: Re: Date - Timestamp format for inserts?

> What's wrong with this statement?

Although the doc in
http://db.apache.org/derby/docs/dev/ref/rrefsqlj27620.html
appears to say that the minutes and seconds portions of the timestamp value
can be ommitted, the code does not appear to conform to that behavior.

So instead of '2006-09-10-00', use '2006-09-10-00.00.00' or '2006-09-10
00:00:00'.

Hopefully that will be a reasonable solution to your problem for now.

 From what I see by reading through SQLTimestamp.parseDateOrTimestamp(), the
code intends for the minutes and seconds portions to be optional, but the
implementation doesn't handle that, so my initial reaction is that the
documentation is correct and this is a bug in the timestamp parser.

What do others think? Is Derby supposed to accept '2006-09-10-00' as a valid
timestamp value?

The documentation in question appears to have been added as part of
DERBY-234:
http://issues.apache.org/jira/browse/DERBY-234

I've attached some simple experiments I tried, below.

thanks,

bryan

ij> create table tmstp (c1 timestamp);
0 rows inserted/updated/deleted
ij> insert into tmstp values ('1990-03-22 10:00:00');
1 row inserted/updated/deleted
ij> insert into tmstp values ('1990-03-22-11');
ERROR 22007: The syntax of the string representation of a datetime value is
incorrect.
ij> insert into tmstp values ('1990-03-22 11');
ERROR 22007: The syntax of the string representation of a datetime value is
incorrect.
ij> insert into tmstp values ('1990-03-22 11.00');
ERROR 22007: The syntax of the string representation of a datetime value is
incorrect.
ij> insert into tmstp values ('1990-03-22 11.00.00');
ERROR 22007: The syntax of the string representation of a datetime value is
incorrect.
ij> insert into tmstp values ('1990-03-22-11.00.00');
1 row inserted/updated/deleted
ij> insert into tmstp values ('1990-03-22-11.00');
ERROR 22007: The syntax of the string representation of a datetime value is
incorrect.
ij> insert into tmstp values ('1990-03-22-11.00');
ERROR 22007: The syntax of the string representation of a datetime value is
incorrect.
ij> insert into tmstp values ('1990-03-22-11.00.');
ERROR 22007: The syntax of the string representation of a datetime value is
incorrect.



Mime
View raw message