From: <win...@ne...> - 2002-10-31 14:07:40
|
>You lost me. JBoss 4.0 will have support the LIMIT someNumber OFFSET >someNumber syntax. Is that what you are talking about. > >I would like to be able to support Date literals, but I don't want to get >too far in front of the spec. Does anyone know where I can find the ANSI >SQL spec on date literals? (I'm not interested in how Oracle does this... >I want to know the standard In reply to Dain's request for info on date literals the long answer is the ANSI SQL-92 at http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt the more helpfull answer is below, I hope this helps. DATE, TIME and TIMESTAMP Literals A literal that represents a DATE, TIME or TIMESTAMP value consists of the corresponding keyword shown below, followed by text enclosed in single quotes (''). The following formats are allowed: DATE 'date-value' TIME 'time-value' TIMESTAMP 'date-value <space> time-value' A date-value has the following format: year-value - month-value - day-value A time-value has the following format: hour-value : minute-value : second-value where second-value has the following format: whole-seconds-value [. fractional-seconds-value] The year-value, month-value, day-value, hour-value, minute-value, whole-seconds-value and fractional-seconds-value are all unsigned integers. A year-value contains exactly 4 digits, a fractional-seconds-value may contain up to 9 digits and all the other components each contain exactly 2 digits. Examples: DATE '1997-02-19' TIME '10:59:23' TIMESTAMP '1997-02-14 10:59:23.4567' TIMESTAMP '1928-12-25 23:59:30' Interval Literals An INTERVAL literal represents an INTERVAL value and consists of the keyword INTERVAL followed by text enclosed in single quotes, in the following format: INTERVAL '[+ | -] interval-value' interval-qualifier The interval-value text must be a valid representation of a value compatible with the interval data type specified by the interval-qualifier, see Named Interval Data Types. If the interval precision includes the YEAR and MONTH fields, the values of these fields should be separated by a minus sign. If the interval precision includes the DAY and HOUR fields, the values of these fields should be separated by a space. If the interval precision includes the HOUR fields and another field of lower significance (MINUTE and/or SECOND), the values of these fields should be separated by a colon. All fields may contain up to 2 digits except that: The number of digits in the most significant field must not exceed the leading precision defined by the interval-qualifier. If a leading precision is not explicitly specified in the interval-qualifier, the default (2) applies. The SECOND field may have a fractional part, whose maximum length is defined by the interval-qualifier. Examples: INTERVAL '1:30' HOUR TO MINUTE INTERVAL '1-6' YEAR TO MONTH INTERVAL '1000 10:20:30.123' DAY(4) TO SECOND(3) INTERVAL '-199' YEAR(3) **evaluates to -199 INTERVAL '199' YEAR **Invalid : default leading precision is 2 INTERVAL '5.555' SECOND(1,2) **evaluates to 5.55 INTERVAL '-5.555' SECOND(1,2) **evaluates to -5.55 INTERVAL '19 23' DAY TO MINUTE **Invalid : no minutes in literal __________________________________________________________________ The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ |