Description
Changes the name of an attached table.
Syntax
Rename_Table( OrigTableName, database, NewTableName, LockFlag, Status )
Parameters
The Rename_Table subroutine has the following parameters.
Parameter | Description |
---|---|
OrigTableName | Specifies the name of the table to rename. To rename just the dictionary portion of a table, specify DICT.tablename. Specify DATA.tablename to rename the data portion only. Note: If running on a network system, other users must re-attached the renamed table before they can recognize it under its new name. Note: If you do not specify either DICT or DATA, the subroutine renames both the dictionary and the data files. |
database | Specifies the target database for the rename process. If database is null, the table is renamed in the database where tablename exists. |
NewTableName | Specifies the new table name. |
Lockflag | If true (1), lock the table during the rename process. |
Status | If true (1) on return, then the table was renamed successfully. Note that while this does indicate success or failure, the Get_Status() function is the preferred method for obtaining status information. |
See also
Delete_Index, Get_Status, Attach_Table, Alias_Table, Copy_Table
Example
/* Renames the CUST table, in the current database, to CUST_BACKUP, locking the table during the rename process */ OldTableName = 'CUST' NewTableName = 'CUST_BACKUP' dbID = @DBID LockFlag = 1 Status = '' call Rename_Table( OldTableName, dbID, NewTableName, LockFlag, Status )