Date filter in DB2 Connector Stage

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

Post Reply
jagadam
Premium Member
Premium Member
Posts: 107
Joined: Wed Jul 01, 2009 4:55 pm
Location: Phili

Date filter in DB2 Connector Stage

Post by jagadam »

Hi,

We are using 8.1 version of datastage. I have parallel job in which i am using db2 connector stage to connect to DB2 Database which is the source. Iam trying to load the data into a file. so there are no other stages except the db2 connector stage as source and the sequential file stage as target.

My requirement is to extract the data from one table which has the date field greater than or equal to 2012-01-31. in the where condition iam not to compare it. I tried to cast the date field but still its throwing the error.

error message when trying to use simple equal to statement.

"The data types of the operands for the operation "" are not compatible."

Is there any particular format that I need to use here.

Thanks in advance.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

I would convert my input date string to a date rather than trying to convert date fields to date string... to_date would be your friend here
jagadam
Premium Member
Premium Member
Posts: 107
Joined: Wed Jul 01, 2009 4:55 pm
Location: Phili

Post by jagadam »

Hi,

I did try to do the to_date conversion. It worked for the timestamp field, but it didn't work for the date field. For the date field it is giving the same error.

The data types of the operands for the operation "" are not compatible. SQLSTATE=42818
mobashshar
Participant
Posts: 91
Joined: Wed Apr 20, 2005 7:59 pm
Location: U.S.

Post by mobashshar »

Have you tried single quotes as '2012-01-31' ?
Post Reply