![]() |
|
Archives of the TeradataForumMessage Posted: Thu, 04 Feb 2010 @ 11:16:35 GMT
Hi Steve, this should give you a good insight - as long as you do not have MDS. Did it myself - best is to export the result set via bteq - see example below: I generated the show sel * statements via the comment SQL and copied them into the BTEQ (might also be done also in one script with two exports and one run statement), The Select 'Start: ###db.tab###' (title ' '); is generating nice separators for the parsing of the output - which has then to be coded. you will find also JI there... The output can become quite interesting in case of views on views on views ;-)... Regards Ulrich P.S. same works also for Macros, but need more preparation for the show exec statement as you have to put in dummy parameters...
SAMPLE BTEQ:
.logon sys/user;
.set width 200;
/*
.os "del ./script.txt";
.set titledashes off;
.export Report file = "./script.txt";
select
top 2
'Select ''Start: ###' !! trim(databasename) !! '.' !!
trim(tablename) !!'###'' (title '' '');
show select * from ' !! trim(databasename) !! '.' !!
trim(tablename) !! ';
Select '' End: ###' !! trim(databasename) !! '.' !!
trim(tablename) !!'###'' (title '' '');'
(title ' ')
from dbc.tables
where databasename = 'xxx'
and tablekind = 'V'
and tablename like 'whaterver%'
order by 1
;
.export reset;
*/
.export Report file = "./out.txt";
Select 'Start: ###db.tab###' (title ' '); show select * from db.tab; Select ' End: ###
db.tab ###' (title ' ');
--
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||