Run a Query from external command

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
f3d3r1c0
Participant
Posts: 2
Joined: Wed Jan 20, 2010 3:44 am

Run a Query from external command

Post by f3d3r1c0 »

Hi all,
I have the following problem.

I have a file where there is a column that contains a SQL Command.

I Want read this column and then, for each row that I read, I want execute that query.

Is it possible to do this thing? And how can I do it?

Thank you in advance.

Federico
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

You could do this, but don't expect fantastic performance. Also, you have not indicated what you want to do with the output from these queries.

Basically you need to construct a simple routine that invokes the shell to execute your commands, using the DSExecute() routine or the Perform or Execute statements.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
f3d3r1c0
Participant
Posts: 2
Joined: Wed Jan 20, 2010 3:44 am

Post by f3d3r1c0 »

Thank you for your suggest,

I need to read some columns of a table to get the statistic about a previous feeding of that table.

I try to explain better my problem.

I have a table that contains a column where there are preconstructed query on various tables.

I have to read that column and then I have to execute the query that I have read.

Is not important that I have very high performance because the row that I read is only one and the columns are 3 or 4, so I haven't a big amount of data.

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

Post by chulett »

Pretty sure we understood all that and what Ray posted still stands regarding how they could be executed. However, still curious about the "and then what?" part of the question. Sure, you need to "run" them - but then what? Where does the output need to go?
-craig

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