Skip to content

SQLReplicatorFileInfo

The SQLReplicatorFileInfo utility is a .NET console application that produces the metadata required by the SQL Agent based on information defined in a Synergy repository. The metadata is stored in a JSON file in a profiles configuration directory as tables.table_definitions.json.

When you run the application, it first checks whether a predefined input file, REPLICATOR_CONFIG:SnapshotAgentFiles.lis, is present. If it is, you'll see this prompt:

Process REPLICATOR_CONFIG:SnapshotAgentFiles.lis? (Y/N) [N]:

If you respond Y, you'll be prompted

Produce individual output files (Y/N) [N]: 

However, if you choose not to process the predefined input file, you'll see this:

This utility processes repository file definition names. Options are:

  A single repository file definition name
  Enter * to process all repository file definitions
  Enter the an input file that lists file definitions

Option (ENTER to exit): 

As prompted, enter either the name of a repository file definition, the specification of a different input file that contains a list of repository file definition names, or * to process all repository file definitions.

An input file is formatted like this:

# Standard demo files
DEPARTMENT      # Department file
EMPLOYEE        # Employee file

The input file may contain blank lines and comments preceded by #.

If you enter a single file definition, the name of the output file will be tables<filedefname>.json. For example, if the input file definition is EMPLOYEE, the output file will be tablesemployee.json.

If you enter an input file specification, the name of the output file will be tables.table_definitions.json.

Example Configuration

Here's an example of the metadata that describes the EMPLOYEE.ISM file in the sample environment:

[
 {
  "name": "EMPLOYEE",
  "file_type": "ISAM",
  "file_spec": "SIP_DAT:EMPLOYEE.IS1",
  "record_size": 300,
  "sub_tables": [
   {
    "name": "EMPLOYEE",
    "record_size": 300,
    "columns": [
     {
      "name": "EmpId",
      "data_type": "Int32",
      "native_type": {
       "type": "Decimal",
       "size": 8,
       "signed": false
      },
      "size": 8,
      "precision": 0,
      "position": 0,
      "nullable": false,
      "index": 0
     },
     {
      "name": "EmpFirstName",
      "data_type": "Utf8",
      "native_type": {
       "type": "Alpha",
       "size": 20
      },
      "size": 20,
      "precision": 0,
      "position": 8,
      "nullable": false,
      "index": 1
     },
     {
      "name": "EmpLastName",
      "data_type": "Utf8",
      "native_type": {
       "type": "Alpha",
       "size": 20
      },
      "size": 20,
      "precision": 0,
      "position": 28,
      "nullable": false,
      "index": 2
     },
     {
      "name": "EmpDept",
      "data_type": "Utf8",
      "native_type": {
       "type": "Alpha",
       "size": 15
      },
      "size": 15,
      "precision": 0,
      "position": 48,
      "nullable": false,
      "index": 3
     },
     {
      "name": "EmpHireDate",
      "data_type": "Date32",
      "native_type": {
       "type": "Custom",
       "size": 8,
       "custom_handler": "YYYYMMDD"
      },
      "size": 8,
      "precision": 0,
      "position": 63,
      "nullable": true,
      "index": 4
     },
     {
      "name": "EmpPhoneWork",
      "data_type": "Utf8",
      "native_type": {
       "type": "Alpha",
       "size": 14
      },
      "size": 14,
      "precision": 0,
      "position": 71,
      "nullable": true,
      "index": 5
     },
     {
      "name": "EmpPhoneHome",
      "data_type": "Utf8",
      "native_type": {
       "type": "Alpha",
       "size": 14
      },
      "size": 14,
      "precision": 0,
      "position": 85,
      "nullable": true,
      "index": 6
     },
     {
      "name": "EmpPhoneCell",
      "data_type": "Utf8",
      "native_type": {
       "type": "Alpha",
       "size": 14
      },
      "size": 14,
      "precision": 0,
      "position": 99,
      "nullable": true,
      "index": 7
     },
     {
      "name": "EmpPaid",
      "data_type": "Int32",
      "native_type": {
       "type": "Decimal",
       "size": 1,
       "signed": false
      },
      "size": 1,
      "precision": 0,
      "position": 113,
      "nullable": true,
      "index": 8
     },
     {
      "name": "EmpHomeOk",
      "data_type": "Int32",
      "native_type": {
       "type": "Decimal",
       "size": 1,
       "signed": false
      },
      "size": 1,
      "precision": 0,
      "position": 114,
      "nullable": true,
      "index": 9
     },
     {
      "name": "EmpDateOfBirth",
      "data_type": "Date32",
      "native_type": {
       "type": "Custom",
       "size": 8,
       "custom_handler": "YYYYMMDD"
      },
      "size": 8,
      "precision": 0,
      "position": 115,
      "nullable": true,
      "index": 10
     },
     {
      "name": "EmpHireTime",
      "data_type": {
       "Time32": "Millisecond"
      },
      "native_type": {
       "type": "Custom",
       "size": 4,
       "custom_handler": "HHMM"
      },
      "size": 4,
      "precision": 0,
      "position": 123,
      "nullable": true,
      "index": 11
     },
     {
      "name": "EmpEmail",
      "data_type": "Utf8",
      "native_type": {
       "type": "Alpha",
       "size": 40
      },
      "size": 40,
      "precision": 0,
      "position": 127,
      "nullable": true,
      "index": 12
     },
     {
      "name": "EmpAddressStreet",
      "data_type": "Utf8",
      "native_type": {
       "type": "Alpha",
       "size": 30
      },
      "size": 30,
      "precision": 0,
      "position": 167,
      "nullable": true,
      "index": 13
     },
     {
      "name": "EmpAddressCity",
      "data_type": "Utf8",
      "native_type": {
       "type": "Alpha",
       "size": 20
      },
      "size": 20,
      "precision": 0,
      "position": 197,
      "nullable": true,
      "index": 14
     },
     {
      "name": "EmpAddressState",
      "data_type": "Utf8",
      "native_type": {
       "type": "Alpha",
       "size": 2
      },
      "size": 2,
      "precision": 0,
      "position": 217,
      "nullable": true,
      "index": 15
     },
     {
      "name": "EmpAddressZip",
      "data_type": "Int32",
      "native_type": {
       "type": "Decimal",
       "size": 5,
       "signed": false
      },
      "size": 5,
      "precision": 0,
      "position": 219,
      "nullable": true,
      "index": 16
     }
    ]
   }
  ]
 }
]