Skip to Content

XI/PI: Time Format for ORA insert

Hi SDNer,

I managed to convert date format correctly via XI/PI 7.1 message mapping @DateTrans function.

from

yyyy-MM-dd HH:mm:ss (JDBC Sender-DB2)

to

dd-MMM-yy HH:mm:ss (JDBC Receiver-ORACLE)

1) but I had a issue to Insert target Oracle format into the Oracle DB.

It will works if i ignore the target time (If i use target dd-MMM-yy only)

Hope I could insert in ORACLE db. I guess probably include to_date(..) functions in XI, because I can insert MANUALLY in target DB via SQL statement with e.g. TO_DATE('15-02-2009 12:00:00 AM', 'dd-mm-yyyy HH:MI:SS AM') functions.

Target JDBC SQL Err:

ORA-01830: date format picture ends before converting entire input string

2),

Beside that, Anyway I could convert also the source: HH (24hr) to target hh (12hr) format with AM and PM. hh ( lower 'h' is working for 12hr in XI but it doesn't seems to append AM or PM)

Appreciate any expertise advise.

Steven

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 20, 2009 at 04:57 AM

    Hi,

    Try to create a UDF by taking your input date as parameter.......do the date transformation inside the UDF and then output your target date format from your UDF............

    Regards,

    Rajeev Gupta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 20, 2009 at 05:34 AM

    Hi Steven,

    For the first issue: Can you also check the field length and format that it allows on the target side.?

    For the second issue.You can go for the UDF where in the logic would be like (If HH > 12 append Pm else Am).This should be helpful.

    Thanks,

    Ram.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      If your incoming Time format is in 24Hr format and you want the output in 12hr format, then you can use the below format inside TransformDate fucntion in your XI mapping

      Source Format

      yyyy-MM-dd HH:mm:ss

      Target Format

      MM/dd/yyyy hh:mm:ss a

      So no need of writing a UDF for this.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.