![]() |
|
Archives of the TeradataForumMessage Posted: Tue, 21 Feb 2012 @ 15:22:50 GMT
Hi, I have this requirement of executing SQL query stored in a table. E.g. - Here is the table layout -
Col1 Col2
1. sel * from dbc.tables where tablename = 'abc';
2. sel * from dbc.tables where tablename = 'xyz';
Now, depending on the value of Col1, I would like to execute either the 1st query or the 2nd one. So I would write -
Sel Col2 from sample_table where col1 = 1;
This would return -
sel * from dbc.tables where tablename = 'abc';
as a text in the bteq outfile. But I would like this text to be executed so that it returns a result. I know this can be done through stored procedures but our installation does not give us access to run stored procedures. I am using UNIX to connect to Teradata. Any help would be greatly appreciated. Thanks, Debojit.
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||