Difference between revisions of "COPY TABLE"
Yvonne.milne (Talk | contribs) (Created page with "''Under Construction'' Category: Lianja v9.4") |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | + | ==Purpose== | |
+ | Copy a table to a new table along with its associated files | ||
+ | |||
+ | ==Syntax== | ||
+ | COPY TABLE [<database>!]<sourcetablename> | (<expC>) TO [<database>!]<targettablename> | (<expC>) [IF [NOT] EXISTS] | ||
+ | |||
+ | ==See Also== | ||
+ | [[ADATABASES()]], [[ADD TABLE]], [[ALTER TABLE]], [[ALTER INDEX]], [[CLOSE DATABASES]], [[CLOSE TABLES]], [[COMPILE DATABASE]], [[COPY Commands]], [[COPY DATABASE]], [[COPY FILE]], [[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]], [[RENAME TABLE]], [[SET AUTOCATALOG]], [[SET DATADIR]], [[SET EXCLUSIVE]], [[SET SQL]], [[USE]] | ||
+ | |||
+ | ==Description== | ||
+ | The COPY TABLE command copies <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 unless the IF NOT EXISTS clause is specified. If <targettablename> does not exist and the IF EXISTS clause is specified, <targettablename> is not created. | ||
+ | |||
+ | The <tablename1> associated files: memo (.dbt), index (.dbx) and rules (.dbd) are also copied. | ||
+ | |||
+ | The <database>! prefix can optionally be specified for both the source and target tablenames. | ||
+ | |||
+ | ==Example== | ||
+ | <code lang="recital"> | ||
+ | open database southwind | ||
+ | copy table employees to staff | ||
+ | close data | ||
+ | copy table southwind!staff to sw!staff | ||
+ | </code> | ||
+ | |||
+ | [[Category:Documentation]] | ||
+ | [[Category:Commands]] | ||
+ | [[Category:Disk and File Commands]] | ||
[[Category: Lianja v9.4]] | [[Category: Lianja v9.4]] |
Revision as of 11:52, 20 November 2023
Contents
Purpose
Copy a table to a new table along with its associated files
Syntax
COPY TABLE [<database>!]<sourcetablename> | (<expC>) TO [<database>!]<targettablename> | (<expC>) [IF [NOT] EXISTS]
See Also
ADATABASES(), ADD TABLE, ALTER TABLE, ALTER INDEX, CLOSE DATABASES, CLOSE TABLES, COMPILE DATABASE, COPY Commands, COPY DATABASE, COPY FILE, 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, RENAME TABLE, SET AUTOCATALOG, SET DATADIR, SET EXCLUSIVE, SET SQL, USE
Description
The COPY TABLE command copies <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 unless the IF NOT EXISTS clause is specified. If <targettablename> does not exist and the IF EXISTS clause is specified, <targettablename> is not created.
The <tablename1> associated files: memo (.dbt), index (.dbx) and rules (.dbd) are also copied.
The <database>! prefix can optionally be specified for both the source and target tablenames.
Example
open database southwind copy table employees to staff close data copy table southwind!staff to sw!staff