Results 1 to 3 of 3

Thread: DB2 query

  1. #1
    Join Date
    Oct 2007
    Posts
    5

    DB2 query

    select trim(to_char(CURRENT_TIMESTAMP,'MM/YYYY')) from SYSIBM.SYSDUMMY1.

    When I execute this query, I get this error:


    [Star SQL][Star SQL ODBC driver][DB2]THE DATA TYPE,LENGTH OR VALUE OA ARGUMENT 2 OF TO_CHAR IS INVALID.

    Would any one know why??

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Check db2 syntax in manual.

  3. #3
    Join Date
    Oct 2007
    Posts
    1
    SELECT substr(( ADD_MONTHS(CURRENT_TIMESTAMP,6)),4) from SYSIBM.SYSDUMMY1

Posting Permissions

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