Page 1 of 1

Job parameter in where clause of ODBC stage query (DS Server

Posted: Wed Sep 05, 2007 2:21 pm
by ds_is_fun
I have created a job parameter name "dnm".
I need to use the parameter in a count query ...in the ODBC stage (Sql server 05).
select count(deptno) from emp where dname = acct.
I want to parameterizet the deptno like..
select count(deptno) from emp where dname = '#dnm#'; (even tried "#dnm#")

It won't work..is it different in DS Server 8?
pl. help. thanks.

Re: Job parameter in where clause of ODBC stage query (DS Se

Posted: Wed Sep 05, 2007 2:59 pm
by Ultramundane
ds_is_fun wrote:I have created a job parameter name "dnm".
I need to use the parameter in a count query ...in the ODBC stage (Sql server 05).
select count(deptno) from emp where dname = acct.
I want to parameterizet the deptno like..
select count(deptno) from emp where dname = '#dnm#'; (even tried "#dnm#")

It won't work..is it different in DS Server 8?
pl. help. thanks.
Have you tried the Dynamic RDBMS stage to see if it will work in that stage?

Posted: Wed Sep 05, 2007 4:24 pm
by ray.wurlod
What error message is returned when you use

Code: Select all

select count(deptno) from emp where dname = '#dnm#'
(Have you tried it without the terminating semi-colon?)

Re: Job parameter in where clause of ODBC stage query (DS Se

Posted: Wed Sep 12, 2007 4:36 pm
by baigdw
Ultramundane wrote:
ds_is_fun wrote:I have created a job parameter name "dnm".
I need to use the parameter in a count query ...in the ODBC stage (Sql server 05).
select count(deptno) from emp where dname = acct.
I want to parameterizet the deptno like..
select count(deptno) from emp where dname = '#dnm#'; (even tried "#dnm#")

It won't work..is it different in DS Server 8?
pl. help. thanks.
Have you tried the Dynamic RDBMS stage to see if it will work in that stage?
You can also try just passing the parameter as #dnm# without quotes and as mentioned the Error mesage would help and if you use the DRS Stage it will give you the output of the sql query passed so you can see how the parameter is being interpreted.