Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4986950

Leading zeros in JDBC Escapes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 8.0pe
    • core-libs
    • beta2
    • sparc
    • solaris_8
    • Not verified

      13.4.2 Date and Time Literals

      Data sources differ widely in the syntax they use for date, time, and timestamp literals. The JDBC API supports ISO standard format for the syntax of these literals, using an escape clause that the driver translates to native syntax.
      The escape syntax for date literals is:
      {d 'yyyy-mm-dd'}

      The driver will replace the escape clause with the equivalent native representation. For example, the driver might replace {d 1999-02-28 } with '28-FEB-99' if that is the appropriate format for the underlying data source.

      ---------------------
      For example, the pointbase.dml file (and others have the following)

      Date_Tab_Insert=insert into Date_Tab values({d '1999-5-5'}, null)


      Some drivers require padding with a leading zero:

      Date_Tab_Insert=insert into Date_Tab values({d '1999-05-05'}, null)
      ###@###.### 2004-02-02

            lancea Lance Andersen
            lancea Lance Andersen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: