|
|
Archives of the TeradataForum
Message Posted: Thu, 08 Apr 2010 @ 21:07:40 GMT
Subj: | | Re: Finding data types in views |
|
From: | | Pradip.Bhogal |
You can use following SQL to generate Select statements and Export result set to excel file using those statements.
SEL
'SEL '||
''''||DATABASENAME||''''||','||''''||TABLENAME||''''||','||''''||COLUMNNAME|
|''''||','||' TYPE('||TRIM(COLUMNNAME)||')'||'
'||'FROM '||TRIM(DATABASENAME)||'.'||TRIM(TABLENAME)||' SAMPLE 1;'
(VARCHAR(200))
FROM
( SEL A.DATABASENAME ,A.TABLENAME ,A.COLUMNNAME FROM DBC.COLUMNS A ,DBC.TABLES B
WHERE A.DATABASENAME = B.DATABASENAME
AND A.TABLENAME = B.TABLENAME
AND A.DATABASENAME = 'DATABASENAME'
AND TABLEKIND ='V'
) A
ORDER BY 1
-Pradip Singh
| |