Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : COPY_DATA

COPY_DATA
Copies data from one table or table instance to another table or table instance. (C)
Invocation
CALL COPY_DATA(srctabspec, select, desttabspec, srclocation, destlocation, overwrite)
 
Usage Notes
If the tables specified in srctabspec and desttabspec are parameterized, specify only data parameters, not location parameters.
If you specify an empty string for select, all occurrences are copied from the table.
When copying IDgen tables, the IDgen key values are regenerated on the target table. IDgen key values do not change if batch utilities are used.
The syntax for select is field_name relational_operator value.
Specify only values for srclocation and destlocation if the data are located on different nodes.

Exceptions
 
Both exceptions should be handled by the calling rule. More information describing the circumstances of the failure is in the @OBJECTMSG.MSG field.
Example
COPY_DATA_1 Rule
The following rule copies selected occurrences from the table instance EMPLOYEES_REMOTE(CANADA) on node NODE3, to the table EMPLOYEE_CENTRAL on node NODE3B:

 
RULE EDITOR ===> SCROLL: P
COPY_DATA_1;
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ CALL COPY_DATA('EMPLOYEES_REMOTE(CANADA)', 'MGR#=56112', | 1
_ 'EMPLOYEE_CENTRAL', 'NODE3', 'NODE3B', ''); |
_ ---------------------------------------------------------------------------

 
COPY_DATA_2 Rule
The following rule copies all instances from table EMPLOYEES_REM to EMPLOYEES. Both tables are on the same node.

 
RULE EDITOR ===> SCROLL: P
COPY_DATA_2;
_ LOCAL A, B;
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ FORALL $EMPLOYEES_REM : | 1
_ A = 'EMPLOYEES_REM(' || $EMPLOYEES_REM.REGION || ')'; |
_ B = 'EMPLOYEES(' || $EMPLOYEES_REM.REGION || ')'; |
_ CALL COPY_DATA(A, '', B, '', '', ''); |
_ END; |
_ ---------------------------------------------------------------------------

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved