Use COPY OBJECTS to define source to target column mapping where the number of columns differs.

Syntax

COPY OBJECTS source TO target
[(PRIMARY KEY, UNIQUE INDEX, OTHER INDEX, CHECK, REFERENCE, TRIGGER, VIEW)];

Arguments

  • source - originating Datasource.

    • If column list included, the order must correspond to target columns in same position. Source columns not listed are ignored.
  • target - Destination datasource. If columns included:

    • Use NULL to indicate nothing required from source for that column.

    • columns renamed when SQL is generated to create database objects.

  • [(PRIMARY KEY,…)] - include Primary Key, Triggers, Constraints or Indexes.

  • [ON ERROR {CANCEL IGNORE}] - change the default error handling of the compound statement, essentially adding the same clause to the surrounding block.

Additional Information

  • Cirro cannot obtain table columns from MySQL and Oracle views.

Expected Results

  • Source column data replicated on target

  • Columns marked NULL are skipped.

  • Target columns named according to source [(colA,…)]

Examples

Rename source columns on target

COPY OBJECTS MySource(id, prop3, words, fk1, prop2)
  TO Mytarget(id, update_time, words, fk1, prop2)
ONLY (PRIMARY KEY, TRIGGER) ;

Skip the third source column on target

COPY OBJECTS MySource TO MyTarget (col1, col2, NULL, col3)