locked
DateTime Format in Oracle RRS feed

  • Question

  • Iam reading from Oracle DB Using legacy Oracle Adapter. One of the fields is Datetime Format. I want to capture this datetime value in my BAM report. The dateformat that is coming out of Oracle is like this 2010-10-25T18:30:00.000000-00:00 How to convert this into 2010-10-25T18:30:00.000 which is acceptable to BAM ? I want to convert the datetime format coming out of oracle in to string format within map how to achieve this? Thanks
    Tuesday, October 26, 2010 12:02 PM

Answers

  • Looks like, difference between source and destination formats seems to be the right most 10 characters in the source value. So you could just use some String manipulation operations (Like Left or Substring using string.length-10 as one of the parameters)  on the source node inside map to strip of the last 10 characters.

    HTH,


    Please mark it as answer by clicking on "Propose As Answer", if it helps
    • Marked as answer by Harik98 Wednesday, October 27, 2010 7:25 AM
    Tuesday, October 26, 2010 12:39 PM

All replies

  • Looks like, difference between source and destination formats seems to be the right most 10 characters in the source value. So you could just use some String manipulation operations (Like Left or Substring using string.length-10 as one of the parameters)  on the source node inside map to strip of the last 10 characters.

    HTH,


    Please mark it as answer by clicking on "Propose As Answer", if it helps
    • Marked as answer by Harik98 Wednesday, October 27, 2010 7:25 AM
    Tuesday, October 26, 2010 12:39 PM
  • Hi,

    You basically have a two options. Change the activity defintion to hold string instead of datetime. Of course you will lose the option to do some date calculations afterwards because the type is now string.

    Another option is to format the date as SQL datetime in an orchestration using code in an expression shape. Store this formatted date in a custom context property or message element to be able to use it in the TPE. If you use the BAM API from the orchestration (instead of TPE) you can also store the formatted value in an orchestration variable and write that to BAM.

     

     

     


    HTH,

    Randal van Splunteren - MVP, MCTS BizTalk Server
    http://biztalkmessages.vansplunteren.net

    Please mark as answered if this answers your question.

    Check out the PowerShell provider for BizTalk: http://psbiztalk.codeplex.com
    Tuesday, October 26, 2010 1:22 PM
    Moderator
  • Using String manipulation Iam able to get the records in BAM. Thanks for the help.
    Wednesday, October 27, 2010 7:25 AM