Results 1 to 4 of 4

Thread: dateformat

  1. #1
    Join Date
    Jul 2012
    Posts
    28

    Unanswered: dateformat

    Set current schema = "ABC" @
    set current function path SYSIBM, SYSIBMADM, SYSFUN, SYSPROC, SYB, S9MODEL, "ABC" @
    SET OPTION DATFMT = *EUR @
    Create procedure p1 (in empno integer)
    begin
    select firstnme from emp where employeeno = empno;
    end
    @

    i am getting this error:An unexpected token "DATFMT = *EUR" was found following "SET OPTION ". Expected tokens may include: "<space>".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.13.111.

    Can u give me solution for this. I am trying to set the dateformat to EUR. (using DB2 9.7 on windows)

    This is just a sample code.

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    I haven't found "SET OPTION" and/or DATFMT in the manual. Can you give us a reference where this is documented? Then we could figure out if it should work and how.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    set option datfmt is Sybase/SQL-server syntax.
    This syntax is not valid in DB2 at version 10.1.

    For DB2 LUW, if you want to explicitly set the date format, use either the CHAR function or the VARCHAR_FORMAT function with appropriate arguments.

    If you don't explicitly set the date format, DB2 determines it from the current locale of the client program (if dynamic SQL coming from a client).

  4. #4
    Join Date
    Jun 2007
    Location
    germany
    Posts
    155
    SET OPTION DATFMT is an iseries option in db2 UDB
    http://publib.boulder.ibm.com/infoce...mstsoption.htm
    Dick Brenholtz, Ami in Deutschland

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •