Copy Table Command

After a table is defined, you can clone the definition with the Copy Table command. You can modify any table that you own, and copy any table to your own workspace that exists in any user definition to which you belong or that is defined as visible to you. As an alternative to copying definitions, Business Administrators can change their workspace to that of another user to work with tables that they do not own.

This page discusses:

Syntax

If you are a Business Administrator with table access, you can copy system tables. If you are a Business Administrator with person access, you can copy tables in any person’s workspace (likewise for groups and roles). Other users can copy visible workspace tables to their own workspaces.

This command lets you duplicate table definitions with the option to change the value of clause arguments:

copy table SRC_NAME DST_NAME [COPY_ITEM {COPY_ITEM}] [MOD_ITEM {MOD_ITEM}];
  • SRC_NAME is the name of the table definition (source) to be copied.
  • DST_NAME is the name of the new definition (destination).
  • COPY_ITEM can be:
    COPY_ITEMSpecifies
    fromuser USERNAMEUSERNAME is the name of a person, group, role or association.
    touser USERNAME
    overwriteReplaces any table of the same name belonging to the user specified in the touser clause.

    The order of the fromuser, touser and overwrite clauses is irrelevant, but MOD_ITEMS, if included, must come last.

  • MOD_ITEMs are modifications that you can make to the new definition. For more information, see Modify Table Command.

To copy a system table use “system” as both the fromuser and touser name. For example:

copy table PartTable SpecTable fromuser system touser system;

History Clause

The history keyword adds a history record marked “custom” to the system table that is being copied. The STRING argument is a free-text string that allows you to enter some information describing the nature of the copy operation. For more information, see Adding History to Administrative Objects.

The history clause applies only to system tables; it does not apply to user tables.