7.15 DDL

Use the @DDL function to return information about a DDL operation.

Syntax

@DDL ({TEXT | OPTYPE | OBJNAME | OBJTYPE | OBJOWNER})
OBJNAME

Returns the name of the object that is affected by the DDL.

OBJOWNER

Returns the name of the owner of the object that is affected by the DDL.

OBJTYPE

Returns the type of object that is affected by the DDL, such as TABLE or INDEX)

OPTYPE

Returns the operation type of the DDL, such as CREATE or ALTER.

TEXT

Returns the first 200 characters of the text of the DDL statement.

Example

The following example uses the output from @DDL in an EVENTACTIONS shell command.

DDL INCLUDE OBJNAME src.t* &
EVENTACTIONS (SHELL ('echo The DDL text is var1> out.txt ', &
VAR var1 = @DDL (TEXT)));

The redirected output file might contain a string like this:

The DDL text is CREATE TABLE src.test_tab (col1 int);