Skip to content

Getting the DDL of an Object (@ddl)

Only in DbVisualizer Pro

This feature is only available in the DbVisualizer Pro edition.

Using the @ddl client-side command, you get the DDL of a database object in a script, for example the CREATE TABLE statement of a table.

@ddl table="SAKILA.STAFF";

Syntax

@ddl <type>="<name>" [drop="true|false"] [constrCtrl="noconstr|onlyconstr"]
ParameterDefaultDescription
<type>The type of object, see Object types.
<name>The qualified name of the object, such as SAKILA.STAFF. The name is case-sensitive.
droptrue adds a DROP statement before the CREATE statement.
constrCtrlOnly for tables. noconstr leaves out the constraints that may make creating the table or inserting data fail: foreign keys and check constraints. onlyconstr gives ALTER statements that add those constraints, instead of the CREATE statement.

Object types

TypeDatabases
table, indexesfortable, view, procedure, function, triggerAll
package, packagebody, objecttype, objecttypebody, sequence, synonymOracle
moduleMimer SQL

Examples

Creating a table without its constraints first

To copy tables that refer to each other, create all tables without their constraints first, and add the constraints when the data is in place:

@ddl table="SAKILA.STAFF" constrCtrl="noconstr";
@ddl table="SAKILA.STAFF" constrCtrl="onlyconstr";