WHERE clause of a SQL as Parameter ?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

WHERE clause of a SQL as Parameter ?

Post by kaps »

Has anyone used the whole Where clause of a SQL as a PArameter to the job ? What I am finding is that it's not recognizing values within quotes... I am trying to do this so that I can make a job a multi instance job...

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If "not recognizing values" means you are losing the quotes, check here. Otherwise, please explain.
Last edited by chulett on Mon Jun 23, 2014 2:33 pm, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

Found the issue. It's weird... When you have part of where clause as parm and part in the sql statement it fails...see below...

Fails with the following:
-------------------------
Select Col1 from Table1
where #Wherecluase# And Cond2

Runs with the following:
--------------------------
Select Col1 from Table1
where #Wherecluase# Cond2

If I move the AND inside the parmatere it runs otherwise it throws unexpected token error...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not totally surprising. Since the parameter is optional the SQL should be crafted such that it can stand alone if a value is not provided.
-craig

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