Page 1 of 1

Date filter in DB2 Connector Stage

Posted: Sun Mar 11, 2012 8:59 pm
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.

Posted: Sun Mar 11, 2012 11:22 pm
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

Posted: Mon Mar 12, 2012 12:22 pm
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

Posted: Mon Mar 12, 2012 3:08 pm
by mobashshar
Have you tried single quotes as '2012-01-31' ?