12.8. Generating Data Definition LanguageSo far this chapter has introduced tools and utilities that you can use to extract data and table definitions using export. In cases when you just want to extract the definition of a table, the db2look command comes very handy. db2look extracts the Data Definition Language (DDL) of database objects. Besides that, the tool can also generate the following:
The syntax diagram for the db2look command in Figure 12.33 shows all the supported options. Figure 12.33. Syntax diagram of the db2look command>>-db2look---d--DBname--+----+--+-------------+-----------------> '--e-' '--u--Creator-' >--+------------+--+-----------------------------------+--------> '--z--schema-' '-+---------------+--+------------+-' | .-------. | '--tw--Tname-' | V | | '--t----Tname-+-' >--+---------------+--+----+--+-----------+--+----+-------------> | .-------. | '--h-' '--o--Fname-' '--a-' | V | | '--v----Vname-+-' >--+--------------------+--+----+--+----+--+-----+--+----+------> '--m--+----+--+----+-' '--l-' '--x-' '--xd-' '--f-' '--c-' '--r-' >--+----------------+--+----+--+----+--+----+--+---------+------> '--td--delimiter-' '--p-' '--s-' '--g-' '--noview-' >--+--------------------------+--+-----------------+------------> '--i--userid---w--password-' +--wrapper--Wname-+ '--server--Sname--' >--+--------+-------------------------------------------------->< '--nofed-' Refer to the DB2 Command Reference Manual for more information about each option. The following examples demonstrate how the command can be used.
|