Hi,
Using:
PowerCenter 7.1.5
Database : Oracle 8i
Source table has a column (SOURCE_COL) with string data type but has date values in it, in this format '09-MAR-2007'
Target table has a column (TARGET_COL) with date data type. The date format in this database is 'MM/DD/YYYY'
So, I use an expression transformation to convert to date format using the TO_DATE function. However, this does not work.
In the expression transformation I created 3 ports:
IN_SOURCE_COL (string type)
VAR_SOURCE_COL (date type)
- here, I use the formula "TO_DATE(IN_SOURCE_COL,'MM/DD/YYYY')"
OUT_SOURCE_COL (date type)
- here, I simply call VAR_SOURCE_COL
I then connect the OUT_SOURCE_COL to the TARGET_COL. I get a valid expression and mapping. And the workflow executes fine, however, it does not actually write anything to that target column. I get the following error message in the log file:
" Error message is [<<Expression Error>> [TO_DATE]: invalid string for converting to Date "
So, it seems that PowerCenter can't convert this string '09-MAR-2007' to this date format '3/9/2007'
Can anyone help here?
Thanks,
Mirogak
Using:
PowerCenter 7.1.5
Database : Oracle 8i
Source table has a column (SOURCE_COL) with string data type but has date values in it, in this format '09-MAR-2007'
Target table has a column (TARGET_COL) with date data type. The date format in this database is 'MM/DD/YYYY'
So, I use an expression transformation to convert to date format using the TO_DATE function. However, this does not work.
In the expression transformation I created 3 ports:
IN_SOURCE_COL (string type)
VAR_SOURCE_COL (date type)
- here, I use the formula "TO_DATE(IN_SOURCE_COL,'MM/DD/YYYY')"
OUT_SOURCE_COL (date type)
- here, I simply call VAR_SOURCE_COL
I then connect the OUT_SOURCE_COL to the TARGET_COL. I get a valid expression and mapping. And the workflow executes fine, however, it does not actually write anything to that target column. I get the following error message in the log file:
" Error message is [<<Expression Error>> [TO_DATE]: invalid string for converting to Date "
So, it seems that PowerCenter can't convert this string '09-MAR-2007' to this date format '3/9/2007'
Can anyone help here?
Thanks,
Mirogak