Pass an entire SQLQuery as a parameter, in userdefined sql?

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
ds_infy
Premium Member
Premium Member
Posts: 59
Joined: Tue Jun 09, 2009 4:17 am
Location: India

Pass an entire SQLQuery as a parameter, in userdefined sql?

Post by ds_infy »

I have a job that extracts records from an oracle db. The same job is used to extract where only the SQL query changes. Can i use the same job for both extracts by passing the Query as a parameter?If so is there any particular syntax that needs to be adhered to?
BugFree
Participant
Posts: 82
Joined: Wed Dec 13, 2006 6:02 am

Post by BugFree »

Yes. We can parameterize the query. No seperate syntax.
It worked for me for simple queries.
I am not sure about the complex/Huge queries.

One more thing is, if you are running this job at a time for different queries, make sure that you build this job with Multi Instance enabled.
Ping me if I am wrong...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, the user-defined query can be a parameter. You just have to ensure that the column names and number of columns returned matches.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Lookout for any quote or special characters which may interrupt the string.
Post Reply