Page 1 of 1
Run a Query from external command
Posted: Mon Dec 13, 2010 10:25 am
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
Posted: Mon Dec 13, 2010 2:35 pm
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.
Posted: Tue Dec 14, 2010 1:53 am
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
Posted: Tue Dec 14, 2010 7:13 am
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?