Returns a LONG VARCHAR string containing the SQL statements required to create the specified table and its indexes, foreign keys, triggers and granted permissions.
sa_get_table_definition( @table_owner, @table_name )
@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.
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.
DBA authority required
None
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)) ; |
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |