Implement SQL standard FORMAT clause for CAST between string types and datetime 
types
-------------------------------------------------------------------------------------

                 Key: CORE-6507
                 URL: http://tracker.firebirdsql.org/browse/CORE-6507
             Project: Firebird Core
          Issue Type: New Feature
          Components: Engine
            Reporter: Mark Rotteveel


Implement SQL standard FORMAT clause for CAST between string types and datetime 
types, to allow custom formatting of datetime values and conversion from string 
values with a specific format to datetime values.

"""
<cast specification> ::=
  CAST <left paren>
    <cast operand> AS <cast target>
    [ FORMAT <cast template> ]
    <right paren>

<cast operand> ::=
    <value expression>
  | <implicitly typed value specification>

<cast target> ::=
    <domain name>
  | <data type>

<cast template> ::=
    <character string literal>
"""

Where <cast template> follows the rules of Subclause 9.42, "Converting a 
datetime to a formatted character string" or Subclause 9.43, "Converting a 
formatted character string to a datetime". Specific syntax rules defined in 
Subclause 9.44, "Datetime templates":

"""
<datetime template> ::=
    { <datetime template part> }...

<datetime template part> ::=
    <datetime template field>
  | <datetime template delimiter>

<datetime template field> ::=
    <datetime template year>
  | <datetime template rounded year>
  | <datetime template month>
  | <datetime template day of month>
  | <datetime template day of year>
  | <datetime template 12-hour>
  | <datetime template 24-hour>
  | <datetime template minute>
  | <datetime template second of minute>
  | <datetime template second of day>
  | <datetime template fraction>
  | <datetime template am/pm>
  | <datetime template time zone hour>
  | <datetime template time zone minute>

<datetime template delimiter> ::=
    <minus sign>
  | <period>
  | <solidus>
  | <comma>
  | <apostrophe>
  | <semicolon>
  | <colon>
  | <space>

<datetime template year> ::=
    YYYY | YYY | YY | Y

<datetime template rounded year> ::=
    RRRR | RR

<datetime template month> ::=
    MM

<datetime template day of month> ::=
    DD

<datetime template day of year> ::=
    DDD

<datetime template 12-hour> ::=
    HH | HH12

<datetime template 24-hour> ::=
    HH24

<datetime template minute> ::=
    MI

<datetime template second of minute> ::=
    SS

<datetime template second of day> ::=
    SSSSS

<datetime template fraction> ::=
    FF1 | FF2 | FF3 | FF4 | FF5 | FF6 | FF7 | FF8 | FF9

<datetime template am/pm> ::=
    A.M. | P.M.

<datetime template time zone hour> ::=
    TZH

<datetime template time zone minute> ::=
    TZM
"""

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to