Archives of the TeradataForum
Message Posted: Mon, 27 Feb 2006 @ 16:18:01 GMT
Subj: | | Re: Latest DDL's ..... |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Monday, February 27, 2006 11:20 -->
Use SQL to write SQL, then run that SQL...
SELECT 'SHOW '||CASE TABLEKIND
WHEN 'T' THEN 'TABLE '
WHEN 'V' THEN 'VIEW '
WHEN 'M' THEN 'MACRO '
ELSE ' '
END||TRIM(DATABASENAME)||'.'||TRIM(TABLENAME)||';'
(TITLE '')
FROM DBC.TABLES
WHERE DATABASENAME = 'databasename'
Of course, the more types of objects you have in your environment, the more your case statement will grow...
|