IBM Support

JR30986: TO_DATE CALL WHEN ISSUED WITH A PARAMETER MARKER CAUSES SQL0418N

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • TO_DATE is a synonym for TIMESTAMP_FORMAT
    
    However when used with parameter markers as-
    
    String   probquery = "SELECT TO_DATE(?,'DD-MM-YYYY') FROM
    SYSIBM.SYSDUMMY1";
    
    this when executed results in
    SQL0418N  A statement contains a use of a parameter marker that
    is not
    valid.  SQLSTATE=42610.
    
    To get it to work with TO_DATE, we have to explicitly cast the
    parameter marker as follows:
    
    String   goodquery = "SELECT TO_DATE(CAST(? AS
    CHAR(10)),'DD-MM-YYYY') FROM SYSIBM.SYSDUMMY1";
    

Local fix

  • 1)use TIMESTAMP_FORMAT
    2)explicitly typecast as-
    
    TO_DATE(CAST(? AS  CHAR(10)),'DD-MM-YYYY')
    

Problem summary

  • Users affected:
    ALL
    
    Summary:
    TO_DATE CALL WHEN ISSUED WITH A PARAMETER MARKER
    CAUSES SQL0418N
    

Problem conclusion

  • First fixed in DB2 UDB Version 9.5, FixPak 4
    

Temporary fix

Comments

APAR Information

  • APAR number

    JR30986

  • Reported component name

    DB2 UDB ESE WIN

  • Reported component ID

    5765F4101

  • Reported release

    950

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-11-04

  • Closed date

    2009-05-29

  • Last modified date

    2009-05-29

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 UDB ESE WIN

  • Fixed component ID

    5765F4101

Applicable component levels

  • R950 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"950","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
29 May 2009