SQL server multiple queries in Datastage

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
shave
Participant
Posts: 15
Joined: Thu Mar 15, 2007 1:31 am

SQL server multiple queries in Datastage

Post by shave »

Hello

Can you please let me know how to run multiple SQL Sever queries (around 20 for different tables) in Datastage. I don't have permissions for creating stored procedures.

Thanks in Advance
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

your requirement is not very clear. eplain in details, what exactly you want to do.
shave
Participant
Posts: 15
Joined: Thu Mar 15, 2007 1:31 am

Post by shave »

I need to run a set of SQL server queries and save the results into a text file.
I know that one way is to create stored procedure and use stored procedure stage. But I dont have permissions from DBA.

Let me know how can i execute these multiple SQL Server queries in Datastage.
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

its still not clear.

do you want to store the output in a single file?

does the output column of the queries are same?

if yes then, can you write user defined query and union to to run as a single query.
shave
Participant
Posts: 15
Joined: Thu Mar 15, 2007 1:31 am

Post by shave »

I want to store the results of all my queries into a singlefile

and the columns were not related as I am using many tables. Seperate queries with different columns
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can still do a 'union' if the queries all return the same number of columns and like column types.

:idea: If you take a moment and actually provide some detail for your question rather than just basically repeating the same thing you might get some better advice. So... how similar are these queries?
-craig

"You can never have too many knives" -- Logan Nine Fingers
John Smith
Charter Member
Charter Member
Posts: 193
Joined: Tue Sep 05, 2006 8:01 pm
Location: Australia

Post by John Smith »

Are the SQL queries look the same? You can use RCP in a generic job that can run all your queries.
Post Reply