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

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

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

Post 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.
Those who throw objects at crocodiles should be asked to retreive 'em.
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

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

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
baigdw
Participant
Posts: 15
Joined: Tue Jan 31, 2006 3:56 pm

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

Post 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.
:P
Baig
Nothing is Impossible in this world. TRY ..try till you Succeed.
Post Reply