Difference between revisions of "RENAME TABLE"
Yvonne.milne (Talk | contribs) (Created page with "''Under Construction'' Category: Lianja v9.4") |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | + | ==Purpose== | |
+ | Change the name of a table | ||
+ | |||
+ | ==Syntax== | ||
+ | RENAME TABLE [<database>!]<sourcetablename> | (<expC>) [TO] [<database>!]<targettablename> | (<expC>) | ||
+ | |||
+ | ==See Also== | ||
+ | [[ADATABASES()]], [[ADD TABLE]], [[ALTER TABLE]], [[ALTER INDEX]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[COPY Commands]], [[COPY DATABASE]], [[COPY FILE]], [[COPY TABLE]], [[CREATE DATABASE]], [[CREATE INDEX]], [[CREATE TABLE]], [[CREATE VIEW]], [[DBUSED()]], [[DISPLAY DATABASE]], [[DISPLAY INDEXES]], [[DISPLAY SCHEMAS]], [[DISPLAY TABLES]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[GETENV()]], [[LIST DATABASE]], [[LIST INDEXES]], [[LIST SCHEMAS]], [[LIST TABLES]], [[OPEN DATABASE]], [[REMOVE TABLE]], [[RENAME]], [[RENAME Commands]], [[SET AUTOCATALOG]], [[SET DATADIR]], [[SET EXCLUSIVE]], [[SET SQL]], [[USE]] | ||
+ | |||
+ | ==Description== | ||
+ | The RENAME TABLE command renames <sourcetablename> to <targettablename>. Either filename can be substituted with an <expC>, enclosed in round brackets, which returns a valid filename. If <targettablename> already exists, the original file is overwritten. | ||
+ | |||
+ | The <tablename1> associated files: memo (.dbt), index (.dbx) and rules (.dbd) are also renamed. | ||
+ | |||
+ | The <database>! prefix can optionally be specified for both the source and target tablenames. | ||
+ | |||
+ | ==Example== | ||
+ | <code lang="recital"> | ||
+ | open database southwind | ||
+ | rename table employees to staff | ||
+ | close data | ||
+ | |||
+ | rename table southwind!staff sw!staff | ||
+ | rename table sw!staff southwind!employees | ||
+ | </code> | ||
+ | |||
+ | [[Category:Documentation]] | ||
+ | [[Category:Commands]] | ||
+ | [[Category:Disk and File Commands]] | ||
[[Category: Lianja v9.4]] | [[Category: Lianja v9.4]] |
Revision as of 11:16, 20 November 2023
Contents
Purpose
Change the name of a table
Syntax
RENAME TABLE [<database>!]<sourcetablename> | (<expC>) [TO] [<database>!]<targettablename> | (<expC>)
See Also
ADATABASES(), ADD TABLE, ALTER TABLE, ALTER INDEX, CLOSE DATABASES, CLOSE TABLES, COMPILE DATABASE, COPY Commands, COPY DATABASE, COPY FILE, COPY TABLE, CREATE DATABASE, CREATE INDEX, CREATE TABLE, CREATE VIEW, DBUSED(), DISPLAY DATABASE, DISPLAY INDEXES, DISPLAY SCHEMAS, DISPLAY TABLES, DROP DATABASE, DROP INDEX, DROP TABLE, GETENV(), LIST DATABASE, LIST INDEXES, LIST SCHEMAS, LIST TABLES, OPEN DATABASE, REMOVE TABLE, RENAME, RENAME Commands, SET AUTOCATALOG, SET DATADIR, SET EXCLUSIVE, SET SQL, USE
Description
The RENAME TABLE command renames <sourcetablename> to <targettablename>. Either filename can be substituted with an <expC>, enclosed in round brackets, which returns a valid filename. If <targettablename> already exists, the original file is overwritten.
The <tablename1> associated files: memo (.dbt), index (.dbx) and rules (.dbd) are also renamed.
The <database>! prefix can optionally be specified for both the source and target tablenames.
Example
open database southwind rename table employees to staff close data rename table southwind!staff sw!staff rename table sw!staff southwind!employees