Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » SQL Anywhere Server - SQL Reference » System Objects » System procedures » Alphabetical list of system procedures

 

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)) ;