How to form appropriate date format after retrieve timestamp information from an Oracle database?

How to form appropriate date format after retrieve timestamp information from an Oracle database?

book

Article ID: KB0090393

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Description:
A query returns the date (timestamp) which looks like: 2013-03-21T12:00:16-05:00 . If using this output as the input of another query, where the data type becomes Date without time zone information, the following error is thrown: "2013-03-21T12:00:16-05:00" is not a valid date.  A valid example is "1999-05-31".
Symptoms:
Exception: "2013-03-21T12:00:16-05:00" is not a valid date. A valid example is "1999-05-31".
Cause:
From a database, BW gets the date and time zone information in the format, ‘YYYY-MM-DDTHH:MM:SS-TIMEZONE’. If a user wants to use the retrieved data as an input for a second JDBC activity and input parameter, it cannot be Timestamp. Use the XPATH customized new format.

Resolution

Check the attached project (Filename: DateNewSample.zip). The process is called Mock.

From the first query, get the timestamp such as, "2013-03-21T12:00:16-05:00". For the second query, do the following:


1). In the Configuration Panel, define a parameter (TYPE: VARCHAR) and combine it with the function to_date.


2). In the Input Panel, surround the input parameter by XPATH functiontib:format-dateTime. This removes the timestamp information for you.



Issue/Introduction

How to form appropriate date format after retrieve timestamp information from an Oracle database?

Attachments

How to form appropriate date format after retrieve timestamp information from an Oracle database? get_app