extract ddl

Tools

extract ddl

All,

Is there a way to extract all the ddls for all the tables and views that belongs to a database.

thanks in advance.

pk
2 REPLIES
gg
Enthusiast

Re: extract ddl

select databasename, tablename, tablekind, requesttext
from dbc.tables
where databasename = 'your_db'
order by 1,2
;

You can use The export function of SQL Assistant to export this into html format.

Regards,
Enthusiast

Re: extract ddl


SELECT 'show table '|| trim(DATABASENAME) ||'.' || TRIM(TABLENAME) ||' ;'
FROM DBC.TABLES
WHERE DATABASENAMElike 'example_%'
and tablekind = 'T'
--AND TABLENAME LIKE '%example%'

ORDER BY DATABASENAME, TABLENAME ASC

--copy results to new window - export results to txt file and run query..... do it all in BTEQ if you will use often

david pracy