Conversion from type "timestamp" to type "dat

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Almost certainly yes. Have you bothered to Search DSXchange?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

1. Pls post 1 date data

2. Confirm source and target data type.

3. Try to load using ODBC

4. Job design

5. Meothod used to load.

DS User
saraswati
Premium Member
Premium Member
Posts: 149
Joined: Thu Feb 28, 2008 4:25 pm

Post by saraswati »

The sample date format is 10/25/2011.

As mentioned earlier,the data type of target table in job 1 is DATE.In the Job 2,the source oracle stage in which table which got populated from job 1 is the source also has the column datatype as DATE.

I want to use ORACLE stage.

I am just using SELECT .... FROM TABLE in the source stage and while viewing the data,I am getting this conversion error.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

You never said before, that you are getting this error while read the data!!

Use to_char in the Select query and change the data type as varchar for that Column while read the data.

In the TFM use StringToDate (Col,'DD/MM/YYYY') and chage the data type as Date

I trust this should work and not sure what else missing in this!!

DS User
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post by BI-RMA »

Oracle DATE-format is in format Timestamp from the point of view of DataStage. To compare an Oracle-date to a date in DataStage-internal format, do the following:

- select the date-value in timestamp-format from Oracle
- use Conversion-function TimestampToDate in Transformer or DateFromTimestamp in ModifyStage

After this you can match both values in DataStage-Date-format. No implicit conversion required.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
saraswati
Premium Member
Premium Member
Posts: 149
Joined: Thu Feb 28, 2008 4:25 pm

Post by saraswati »

Getting this error after following the above advice:

APT_CombinedOperatorController,0: Data string '25/10/2011' does not match format '%yyyy-%mm-%dd': the value for tag %yyyy has fewer characters than expected.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The problem there is pretty obvious - compare the date example with the format noted in the message. They need to match.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply