Professional > Table scripting > Getting started > Table population and failover
 
Table population and failover
Sample script file: FailoverDemo.mrs
In certain cases, you can populate many tables via a batch process. Occasionally some of the tables may fail to populate (due to issues such as not enough memory for example).
Before version 6.0, a single table population failure would cause the entire batch process to fail. Starting with version 6.0, you can now populate the remaining batch tables when one or more fail. You can check if any tables failed and iterate the tables to repopulate failed tables.
The following sample demonstrates how to make use of the failover feature. The sample script FailoverDemo.mrs uses the museum example to create and populate ten tables.
When calling the Populate method, using the following codes to determine if any tables failed.
bSuccess = TableDoc.Populate()
When bSuccess is false, you can attempt to repopulate the failed tables. When failure is the result of insufficient resources, repopulating the failed tables one-at-a-time will usually resolve the problem.
Example
If bSuccess <> True Then
  Dim Table
  For Each Table in TableDoc.Tables
    If Len(Table.PopulateError) > 0 Then
      TableDoc.Populate(Table.Name)
    End If
  Next
End If
When exporting a failed table, the population errors are displayed in the output's population warning section.
Requirements
UNICOM Intelligence Reporter
See also
Getting started