sa_get_table_definition system procedure

Returns a LONG VARCHAR string containing the SQL statements required to create the specified table and its indexes, foreign keys, triggers and granted permissions.

Syntax
sa_get_table_definition( @table_owner, @table_name )
 
Arguments
  • @table_owner   Use this CHAR(128) parameter to specify the owner of @table_name.

  • @table_name   Use this CHAR(128) parameter to specify the name of the table.

Remarks

To create a new table with the same definition, use the string returned by the sa_get_table_definition system procedure with the EXECUTE IMMEDIATE statement and the LOCATE, SUBSTRING, and REPLACE functions.

Permissions

DBA authority required

Side effects

None

See also
Example

The following statement uses the sa_get_table_definition system procedure to display the string containing the SQL statements required to create the Departments table.

SELECT row_value
FROM sa_split_list( sa_get_table_definition( 'GROUPO', 'Departments'), CHAR(10)) ;