Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

Exporting the MaxDB Table definition to files using SQLCLI and SQL Studio

Every database table has a definition that describes it. Any change made to this definition causes a direct impact on the table. Importing and exporting of data between different databases and database servers is a quite usual task. But there are situations where we might need to export and import the table definition also. This weblog shows you how the MaxDB table definition can be exported to files.

Table Definition in MySQL

Normally the command DESCRIBE is used to get the table definition. The definition so obtained can be just viewed. But the same cannot be exported. There is no specific command or method that helps to perform the same.



Export MaxDB Table Definiton to file using SQLCLI

In MaxDB SQLCLI the definition of the database table can be obtained using the command \DC followed by the table name. The same has been shown below.



But SQLCLI has \O command that helps in writing the results of executed queries to files. This command can be used to export the table definition to files. Thus the table structures can be easily moved across systems.

The above command creates a file with the EMPLOYEE table definition in it. The file created so is shown below.

There are a few limitations with these definitions; they cannot be used as such for creating tables in other systems. The files has to be modified to a query format to import them into other systems. But this can be overcome using the SQL Studio.

Export MaxDB Table Definiton to file using SQL Studio

The SQL Studio has a special utility called SQL Dialog, in which the table definition can be created as shown below.
1. Right click the table in the catalog Manager and choose Open Object Definition.
2. Right click the table definition and choose Export to SQL Dialog.
3. Right click the SQL Dialog and choose to Export to File.



Thus using these simple procedures the MaxDB table definition can be exported to file using the MaxDB SQLCLI and SQL Studio.

2 Comments