P. 1
Informatica PowerCenter 9.0 Transformation Language Reference

Informatica PowerCenter 9.0 Transformation Language Reference

5.0

|Views: 39,179|Likes:
Published by Dipankar

More info:

Published by: Dipankar on Sep 24, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/20/2015

pdf

text

original

Use the following rules and guidelines when you work with date format strings:

¨The format of the TO_DATE string must match the format string including any date separators. If it does not,
the Integration Service might return inaccurate values or skip the row. For example, if you pass the string
‘20200512’, representing May 12, 2020, to TO_DATE, you must include the format string YYYYMMDD. If you
do not include a format string, the Integration Service expects the string in the date format specified in the
session. Likewise, if you pass a string that does not match the format string, the Integration Service returns an
error and skips the row. For example, if you pass the string 2020120 to TO_DATE and include the format string
YYYYMMDD, the Integration Service returns an error and skips the row because the string does not match the
format string.
¨The format string must be enclosed within single quotation marks.

¨The Integration Service uses the default date time format specified in the session. Default is MM/DD/YYYY
HH24:MI:SS.US. The format string is not case sensitive.

Example

The following examples illustrate the J, RR, and SSSSS format strings. See the individual functions for more
examples.

J Format String

The following expression converts strings in the SHIP_DATE_MJD_STRING port to date values in the default date
format:

TO_DATE (SHIP_DATE_MJD_STR, 'J')

SHIP_DATE_MJD_STR

RETURN_VALUE

2451544

Dec 31 1999 00:00:00.000000000

2415021

Jan 1 1900 00:00:00.000000000

Because the J format string does not include the time portion of a date, the return values have the time set to
00:00:00.000000000.

TO_DATE and IS_DATE Format Strings 31

RR Format String

The following expression converts a string to a four-digit year format. The current year is 1998:

TO_DATE( DATE_STR, 'MM/DD/RR')

DATE_STR

RETURN VALUE

04/01/98

04/01/1998 00:00:00.000000000

08/17/05

08/17/2005 00:00:00.000000000

YY Format String

The following expression converts a string to a four-digit year format. The current year is 1998:

TO_DATE( DATE_STR, 'MM/DD/YY')

DATE_STR

RETURN VALUE

04/01/98

04/01/1998 00:00:00.000000000

08/17/05

08/17/1905 00:00:00.000000000

Note: For the second row, RR returns the year 2005, but YY returns the year 1905.

SSSSS Format String

The following expression converts strings that include the seconds since midnight to date values:

TO_DATE( DATE_STR, 'MM/DD/YYYY SSSSS')

DATE_STR

RETURN_VALUE

12/31/1999 3783

12/31/1999 01:02:03.000000000

09/15/1996 86399

09/15/1996 23:59:59.000000000

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->