Page 1 of 1

Could not pass PARAMETERS to odbc stage

Posted: Fri Sep 19, 2008 7:55 am
by xch2005
Hi,

I need to pass data values (as parameter) to sql in the odbc enterprise stage. SQL works fine if the where clause is hardcoded with dates as,

select ...
from ...
where ...
and d1 > '20081010' and d2 < '20081020'

Is it parameter cannot be passed to an odbc stage? I tried passing as parameter, the job completed successfully but no rows were loaded.

Please let me now your valuable suggestions.

Thanks

Posted: Fri Sep 19, 2008 8:00 am
by chulett
Of course parameters can be used in the stage. You'd have to show us your syntax to know what went wrong. Guessing you may not have enclosed the parameter name in hashes / pound signs.

Posted: Fri Sep 19, 2008 8:59 am
by xch2005
The parameters which are passed are d1 and d2 and used as shown below.

select ...
from ...
where ...
AND e.added_datetime >#d1# AND e.added_datetime < #d2#

It did not work.

Now I am able to run successfully, the only thing which I had missed was the quotes ie. '#d1#' and '#d2#'

Craig, thanks because on reading your post I remembered this.

Thanks

Posted: Fri Sep 19, 2008 9:01 am
by chulett
Yup, exactly right. :wink: