Page 1 of 1

Querying the table based on a condition

Posted: Wed Jul 18, 2007 10:23 pm
by sureshchandra
Hi,

I want to fetch records from a table 'A' based on a condition-
where A.field > B.field . B is another table.
What stage can be used to apply this filter.

Thanks in Advance

Posted: Wed Jul 18, 2007 10:35 pm
by ArndW
If A and B are in the same schema, I would do it in the original SQL where you select your records. That would be the fastest, most efficient method.

Posted: Wed Jul 18, 2007 11:40 pm
by chulett
Wouldn't even have to be in the same schema, the same database would do. Heck, doesn't even need to be that. :wink:

Posted: Wed Jul 18, 2007 11:47 pm
by hamzaqk
use the odbc stage..

create a dummy seq file with a dummy column which reads data from a dummy file with any value just to create an input link to the odbc stage.

seq file ----> odbc

in the odbc stage , choose user defined sql and u r ready to rock and roll !

Posted: Thu Jul 19, 2007 2:54 pm
by ray.wurlod
Just add the appropriate WHERE clause to the link properties in your database stage - probably on a tab called Selection.