parameterisation problem

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
skumar
Participant
Posts: 88
Joined: Thu May 25, 2006 5:11 am
Location: Hyderabad

parameterisation problem

Post by skumar »

Hi All

I am facing a problem while parameterising the query. I have a requirement to paramaeterise the source query.

For Ex: - SELECT * FROM #$SCHEMA#.EMP

I am calling the total query in a job parameter. When I declared the parameter as a string the total query is considered as string which includes Schema value also.

I tried in the parameter sourcequery(my param name) as

SELECT * FROM '":$SCHEMA:"'.EMP
but it is not working...

can some one throw light on this.

Thanks
skumar
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Re: parameterisation problem

Post by jwiles »

If your query, apart from the schema name, can change from run to run, you will need to build the final query before the job is started. DataStage will not replace parameters embedded within parameters.

A Basic routine called by a job sequencer should be able to handle that for you using the EReplace function. The routine should return the final query, which you would store in a user variable and pass as the query parameter to your job.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can't pass in a parameter that contains a parameter, it won't resolve things twice. Your second method should work but use the string you first posted there instead, see if that works.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply