TableOrder (tor) extended option

Specifies the order of tables in the upload.

Syntax
tor=tables; ...
tables = table-name [,table-name], ...
Remarks

This option allows you to specify the order of tables on the remote database that are to be uploaded. Specify tables as a comma-separated list. You must specify all tables that are to be uploaded. If you include tables that are not included in the synchronization, they are ignored.

The table order that you specify must ensure referential integrity. This means that if Table1 has a foreign key reference to Table2, then Table2 must be uploaded before Table1. If you do not specify tables in the appropriate order, an error occurs, except in the two following cases:

  • You set TableOrderChecking=OFF.

  • Your tables have a cyclical foreign key relationship. (In this case, there is no order that satisfies the rule and so the tables involved in the cycle can be uploaded in any order.)

If you do not specify TableOrder, then dbmlsync chooses an order that satisfies referential integrity.

The order of tables on the download is the same as the upload. Control of the upload table order may make writing server side scripts simpler, especially if the remote and consolidated databases have different foreign key constraints.

There are no cases where this option must be used. It is provided for users who want to ensure that tables are uploaded in a specific order.

This option has a short form and long form: you can use tor or TableOrder.

You can also store extended options in the database. For more information about dbmlsync extended options, see Introduction to dbmlsync extended options.

See also
Example

The following dbmlsync command line illustrates how you can set this option when you start dbmlsync:

dbmlsync -e "tor=admin,parent,child"

The following SQL statement illustrates how you can store this option in the database:

CREATE SYNCHRONIZATION SUBSCRIPTION
   TO sales_publication
   FOR ml_user1
   OPTION tor='admin,parent,child';