On this page
COMPARE TABLE STRUCTURE
Compares the columns of a table between the current connection and another connection.
Syntax
COMPARE TABLE STRUCTURE [<schema>.]<table> WITH <connection>
Arguments
| Argument | Required | Values | Default |
|---|---|---|---|
<table> | Yes | The table to compare, found on each side | None |
<schema>. | No | The schema of the table on both sides, followed by a dot | Each side's current schema |
WITH <connection> | Yes | An active connection of the CDF | None |
Examples
COMPARE TABLE STRUCTURE CUSTOMER WITH B;
COMPARE TABLE STRUCTURE SALES.ORDERS WITH PROD_DB;
Details
The other connection
The other connection must be an active connection of the CDF. The command opens its own short-lived connection to it; the current connection stays open and unchanged.
Finding the table on each side
Without a schema, each side uses its own current schema. The name is then tried as typed, in upper case and in lower case, on each side separately, as DESCR does, since two database products may store an unquoted name in a different case.
Report
- the columns that exist on one side only;
- the columns that exist on both sides with a different type, size, decimal digits or nullability, with both definitions;
- the number of columns that match exactly.
When everything matches, a single line says the structure is identical. The command fails when the table does not exist on one side, or when the connection is not defined.
Related
- DESCR
- ENV
- SHOW GROUP, the connections of the same Database Group
Used in these how-tos
Last modified in release 5.5.0.
Found something wrong or unclear on this page? Tell us, with the page address.