IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

  • 1.  Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    Posted Fri October 17, 2008 03:39 PM

    I am trying to query DB2 database using a parameterized dynamic sql. One of the parameter fields is a timestamp in db2 database and webMethods somehow does not like it. This is the error I am getting
    "[ART.114.505] Error while invoking adapter service com.wm.adapter.wmjdbc.services.DynamicSQL. JDBC Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff "

    I tried changing to the format (‘yyyy-mm-dd hh:mm:ss.fffffffff’) but no luck. I tried changing the field format type from String to java.util.date and java.sql.date but no luck.

    DB2 works with format “yyyy-MM-dd-HH.mm.ss.SSSSSS” and if change the sql to a variable substitution it works but we do not want to go that route.

    any suggestions or ideas would be helpful.


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 2.  RE: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    Posted Fri October 17, 2008 04:27 PM

    Can you post the dynamic sql specifics and how you’re calling it?


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 3.  RE: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    Posted Fri October 17, 2008 06:55 PM

    This is how the sql looks like.

    Select * from tmp
    where id in ?

    ID is a timestamp field in tmp table in the db2 database. The ID value comes from a different adapter service call which we are trying to pass it to this call. We get the value in the format (yyyy-MM-dd-HH.mm.ss.SSSSSS) when we use function char on the id so we can use it for subsequent calls. I tried to using this format as well (yyyy-mm-dd hh:mm:ss.fffffffff ) but no luck.

    Tried changing the input parameter field type from string to java.sql.date and java.util.date but still ended with errors.

    Thx in advance for your help.


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    Posted Fri October 17, 2008 07:09 PM

    Shot in the dark. Try:

    select * from tmp where id in ‘?’


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 5.  RE: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    Posted Fri October 17, 2008 07:54 PM

    well we would have to use ‘’ for date field and I am using it already. just did not write it in here.


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 6.  RE: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    Posted Fri October 17, 2008 10:37 PM

    What are the types specified for the field on the 2 adapter services that you mention?


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 7.  RE: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    Posted Sat October 18, 2008 12:55 AM


  • 8.  RE: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    Posted Mon October 20, 2008 06:53 PM

    I got this working and wanted to share it. Do not put quotes (‘’) around the date in any format.

    Call it this way. This goes with char variables as well. I was assuming earlier to put quotes around char/timestamp fields as we would do in a regular sql.

    Select * from tmp
    where id in ? with parameter being yyyy-MM-dd-HH.mm.ss.SSSSSS Good.

    Do not try calling it this way.
    Select * from tmp
    where id in ? with parameter being ‘yyyy-MM-dd-HH.mm.ss.SSSSSS’ BAD.

    or

    Select * from tmp
    where id in ‘?’ with parameter being yyyy-MM-dd-HH.mm.ss.SSSSSS BAD.


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    Posted Tue August 12, 2014 12:59 AM

    Below query works fine when this is executed at the database but fails through db2 jdbc adapter service.

    select sales_order_id from sales_order
    where created_date = TIMESTAMP_FORMAT(‘2014-07-11 12:00:00’, ‘YYYY-MM-DD HH24:MI:SS’)

    But this fails from db2 jdbc CustomSql adapter service with following error:
    [SQL0171] Argument 01 of function TIMESTAMP_FORMAT not valid.

    I tried with suggested ‘yyyy-MM-dd-…SS.fff…’ format, but it does not work.


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 10.  RE: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    Posted Tue August 12, 2014 12:52 PM

    Joy,

    Have you tried this format as suggested GOOD?

    Select * from tmp
    where id in ? with parameter being yyyy-MM-dd-HH.mm.ss.SSSSSS Good.

    HTH,
    RMG


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods