Externalize SQL Query
Moderators: chulett, rschirm, roy
Parameters and SQL Files are mutually exclusive. Only workaround I found was to maintain multiple sql file variations and use parameters in the filename to pull in the right one at the right time. Obviously limits just how dynamic they can be, however.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 12
- Joined: Thu Jan 08, 2004 9:45 am
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
Build template SQL files with a token in place of the filter. sed the token to the desired parameter filters you want at runtime and redirect to a temp SQL file and run the Temp SQL in DataStage. Hopelessly complicated? You betcha! But it makes the SQL file(s) dynamic as opposed to static. Basically another level of abstraction and obfuscation.
-
- Participant
- Posts: 12
- Joined: Thu Jan 08, 2004 9:45 am
Thanks. I'll try this option.throbinson wrote:Build template SQL files with a token in place of the filter. sed the token to the desired parameter filters you want at runtime and redirect to a temp SQL file and run the Temp SQL in DataStage. Hopelessly complicated? You betcha! But it makes the SQL file(s) dynamic as opposed to static. Basically another level of abstraction and obfuscation.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Externalize SQL Query
Resist stupid requirements.vincentjeevan wrote:Hi, I have a requirement to maintain all SQL Queries outside Datastage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
I have done this for a reference data job where I am pulling code and description from dozens of tables but it only works because all the source tables use the same metadata. Different SQL files and the table name and WHERE clause column name are passed in as job parameters.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn