executing SQL queries that are in a table's column

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
vinodhraj
Participant
Posts: 53
Joined: Mon Sep 12, 2005 6:51 am

executing SQL queries that are in a table's column

Post by vinodhraj »

hi,

I am having a query which is in a column of a database table. Is it possible to execute it in DS?

thanks

vinod
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi and Welcome aboard :),
In general yes.
It might be more easy in Server job then in PX job (having realized you posted in the EE forum with Server job type... moving post...).
Can you describe what yoiu need to do in more detail?
Is it only one query or a set of queries?

IHTH,
Last edited by roy on Sat Oct 08, 2005 11:15 am, edited 2 times in total.
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi Again :),
DB Stage performing the select into a single varchar column marked as key going to a DB Stage performing a user defined sql with :1 in it should work (though I don't have DS avail at the moment to verify it).

If this won't work then use a tramsformer to run other jobs that get the statement as parameters and use that as your user defined sql.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
vinodhraj
Participant
Posts: 53
Joined: Mon Sep 12, 2005 6:51 am

Post by vinodhraj »

hi,

one small correction, I have to execute a set a queries and the output should be put into different text files.The name of these text files exists in another column of the table in which the SQL exists.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Are you interested in hiring my services?
This kind of request over private message sounds like it.
If not then you were better off writing this in your post not send it via private message.

Alas I have not the spare time to give you exact tested solution at the moment. (I can assure you it can be done though)
Perhaps some one else can contribute a more precise solution.

P.S.
I posted this in the hope it might actually help you get help here rather then anything else :!:
hi roy,

U had told executing Queries which is in a column of a table can be executed.

My problem is all the queries has to be executed and the results to be populated into as many text files according to their corresponding queries. these text file names were available in another column of the table in which SQL query exists.

any solution

thanks

vinod

please send the reply in this ID's <Email address removed>
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

This is done in several jobs included in EtlStats. Most of these are used in reports. The QA jobs will calculate one measure and store it in a table. There is one measure for a source table and one for the target table then these are compared in a report to show completeness of the data warehouse load. Do a search. These are covered in other posts.
Mamu Kim
Post Reply