Skip to main content
1

Open Export Settings

In the Document Definition editor, select Document Definition → Export Settings.
2

Add a database export profile

Click Add, and select Export to ODBC-compatible database in the Type field.
3

Set the export scope

Specify whether export is obligatory, whether images should be exported, and which documents (with errors, without errors, or both) to export. Click Next.
4

Connect to the database

Enter the connection parameters in the Connection string box, or click Setup and configure them in the Data Link Properties dialog box. Use the provider and driver for your database (see Database providers and drivers). The provider and driver must be available on the computer that performs the export.
5

Select the schema

Select a schema from the dropdown list. For Microsoft SQL, a schema is optional (for export, caching, and rule management); a blank field uses the dbo schema. For PostgreSQL, specify the public schema.
If a database has no tables, the dbo schema is not listed. To use it, select the blank value in the schema field.
6

Map the fields

Click Test Connection to check the connection, and then map the Document Definition fields to the database:
  • To create new tables automatically, click Create Tables Automatically. A separate table is created for each document section, matching the Document Definition fields and their data types.
  • To export to existing tables, click Set Up Field Mapping and, in the Field Mapping dialog box, select a database table for each document section and a column for each field. You can also save data with stored procedures.
Click Next.
7

Set the image options

Complete this step only if images (document images or Picture fields) should be saved.
  1. Choose to save images to the database or as files. For files, set a file naming template (click Edit) and the overwrite behavior (see Rules for naming export files). Specify any fields to conceal. Click Next.
  2. Select the image format, quality, and color. To change the resolution, select Change resolution to and choose a value. For PDF or PDF/A, you can create searchable PDF files. Click Next.
8

Finish

Enter an export profile name and click Finish.

Database providers and drivers

When choosing a provider, note the following:
  • For Microsoft SQL, selecting OLE DB Provider for SQL Server may cause problems with certain data types and long fields.
  • To connect the 64-bit version of FlexiCapture to an Access database, install the 64-bit Access Database Engine x64 driver.
  • For Oracle, see Export to an Oracle database.

Map fields to the database

The Field Mapping dialog box shows document sections and fields on the left and database tables and columns on the right.
  • If the database already has tables, select a database table for each section and a column for each field.
  • If it has no tables, click Create Tables Automatically to create tables with the structure needed for export; document fields are matched to columns.
Field groups, fields with several instances, and document tables are exported to separate tables, linked to the main table by a primary key and a foreign key. FlexiCapture adds these keys automatically where required; you only specify the field the key is exported to.
Use schemas with a small number of objects. Before export, ABBYY FlexiCapture queries the database for information about all objects in the schema, so a large schema can make creating tables take a long time (up to several hours).
You can also:
  • Add a missing column to an existing table automatically: leave the document field matched to a database field of a similar name with (auto) in brackets, or select the field and click Auto.
  • Use Auto to create a new table named after the Document Definition section or table, or New to create a table for each field when the names differ.
  • Use Move Up and Move Down to order the columns in an automatically created table.
  • Use Format to configure how typed fields are saved, for example the number of decimal digits for a Number field, or the format and separators for a Date field.
When exporting a Time field, create a column of the DateTime type in the database table. The default SmallDateTime column causes an error.
Depending on the option you select, Picture field contents and document images can be exported to the file system or the database. When exporting to separate files, the file name and path are stored in the corresponding database field (set when mapping fields). If the export path is on a network disk, make sure all stations that work with it have access. When the path string exceeds 255 characters, an error occurs. Increase the character limit for that column.

Export with stored procedures

Besides exporting to database tables directly, you can save data with stored procedures. A stored procedure is a database object: a set of SQL instructions that is compiled once and stored on the server. Stored procedures can perform numerical and character calculations and standard database operations. Advantages over direct export:
  • Faster work with the database.
  • Additional calculations.
  • Data integrity.
A sample stored procedure for Microsoft SQL:
The three parameters passed to the procedure are fields of a FlexiCapture document: an identifier (UserId), the first name (FirstName), and the last name (LastName). If no entry with that identifier exists in the Users table, a new entry is added. If one exists, its first and last name are replaced with the FlexiCapture field values.

Configure export with stored procedures

Establish a connection to the database first (see the steps above). Click Set Up Field Mapping and select a stored procedure for saving data. Unlike mapping to table columns, the fields offered for export are the procedure’s parameters, which are typed: each parameter type must match the data type of the mapped Document Definition field. Map the document fields to the procedure parameters. To export tables and complex fields (such as fields with several instances) as well as separate fields, set up correct indexes to connect child entries with the main document entry. Specify the return value (@RETURN_VALUE) or an output parameter as the exportable primary key (ROW_INDEX). The procedure then writes data to the table and returns the identifier of the current entry, which is passed to the procedure when exporting child entries.

Export to an Oracle database

Use the authorization scheme that was used for users when exporting data to databases. Specify the following:
  • Role: Connect.
  • Privileges: CREATE ANY TABLE (to create a table), and INSERT ANY TABLE and UNLIMITED TABLESPACE (to export data).
You do not need any privileges to set up the Field Mapping dialog box.
For an Oracle database, avoid field names longer than 30 characters in your Document Definitions. Longer names are truncated when exporting to Oracle.