Exporting a Database Object Definition

Use

You export the definition of a database object, for example, the definition of a table or index.

Procedure

...

       1.      In Catalog Manager, select the database object whose definition you want to export.

       2.      ChooseCatalog Manager ® Open Object Definition.

       3.      Choose the Definition ® Export to SQL Dialog table.

       4.      From the context menu for the SQL dialog, choose Export File and enter the name and path of the file to which you want to export the definition.

Result

The database object definition is exported as an SQL statement.

Example

If a user called MONA exports the definition for the CUSTOMERtable, the following SQL statement is returned:

CREATE TABLE "MONA"."CUSTOMER"

(

   "CNO"               Fixed (4,0)    NOT NULL,

   "TITLE"             Char (7) ASCII,

   "FIRSTNAME"         Char (10) ASCII,

   "NAME"              Char (10) ASCII    NOT NULL,

   "ZIP"               Char (5) ASCII,

   "ADDRESS"           Char (25) ASCII    NOT NULL,

   PRIMARY KEY ("CNO"),

   CONSTRAINT "CNO_CONS" CHECK   "CNO " > 0,

   CONSTRAINT "TITLE_CONS" CHECK "TITLE " IN ('Mr', 'Mrs', 'Company'),

   CONSTRAINT "ZIP_CONS" CHECK   "SUBSTR(ZIP,1,1)" BETWEEN '0' AND '9'     AND

               "SUBSTR(ZIP,2,1)" BETWEEN '0' AND '9'     AND

               "SUBSTR(ZIP,3,1)" BETWEEN '0' AND '9'     AND

               "SUBSTR(ZIP,4,1)" BETWEEN '0' AND '9'     AND

               "SUBSTR(ZIP,5,1)" BETWEEN '0' AND '9',

   FOREIGN KEY "CUSTOMER_ZIP_IN_CITY"  ("ZIP") REFERENCES "MONA"."CITY" ("ZIP") ON DELETE  RESTRICT

)