[
https://issues.apache.org/jira/browse/DERBY-234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461977
]
Dag H. Wanvik commented on DERBY-234:
-------------------------------------
Hi Bryan, Bernt
I don't know the background for the undelimited timestamp literal
syntax. I found it is only accepted as input to the TIMESTAMP
function, not as a stand-alone timestamp literal:
ij> insert into t4 values ('20070101205520');
ERROR 22007: The syntax of the string representation of a datetime value is
incorrect.
ij> insert into t4 values timestamp('20070101205520');
1 row inserted/updated/deleted
This is actually documented here:
http://db.apache.org/derby/docs/10.2/ref/rreftimestampfunc.html
Some of the Derby timestamp syntax extensions (relative to SQL/JDBC), for
example period notation in hh.mm.ss, is there for IBM DB2 compatibility (called
out in the code).
Allowing omission of the leading zero of month, day and hour is also
an extension, as far as I can see.
I would prefer the documentation to clearly mark the standard
syntax. Extensions ease porting apps to Derby, so documenting it is OK
in my view, as longs as the docs make it abundantly clear what is the
preferred (standard) syntax.
I am not sure what the final caveat really means for timestamps
("accepts strings in the locale specific datetime format"), does it
apply? It *is* relevant for date, obviously..
> Documentation of DateTime types is incomplete
> ---------------------------------------------
>
> Key: DERBY-234
> URL: https://issues.apache.org/jira/browse/DERBY-234
> Project: Derby
> Issue Type: Bug
> Components: Documentation
> Affects Versions: 10.0.2.0
> Reporter: Jack Klebanoff
> Assigned To: Bryan Pendleton
> Priority: Minor
> Attachments: derby234.diff, mmss_required.diff, rrefsqlj27620.html
>
>
> The documentation for datatypes DATE, TIME, and TIMESTAMP is incomplete. The
> documentation says that DATE, TIME, and TIMESTAMP accept any values accepted
> by the java.sql.Date, java.sql.Time, and java.sql.Timestamp classes
> respectively. Derby accepts a number of string formats:
> DATE:
> yyyy-mm-dd
> mm/dd/yyyy
> dd.mm.yyyy
> TIME:
> hh:mm[:ss]
> hh.mm[.ss]
> hh[:mm] {AM | PM}
> TIMESTAMP:
> yyyy-mm-dd-hh[.mm[.ss[.nnnnnn]]]
> yyyy-mm-dd hh[:mm[:ss[.nnnnnn]]]
> The year must always have 4 digits. Months, days, and hours may have one or
> two digits. Minutes and seconds, if present, must have two digits.
> Nanoseconds, if present may have 1 to 6 digits.
> Derby also accepts strings in the locale specific datetime format, using the
> locale of the database server. If there is an ambiguity the built in formats
> above take precedence.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira