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.
7
Set the image options
Complete this step only if images (document images or Picture fields) should be saved.
- 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.
- 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.
- 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.
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.
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), andINSERT ANY TABLEandUNLIMITED TABLESPACE(to export data).
For an Oracle database, avoid field names longer than 30 characters in your Document Definitions. Longer names are truncated when exporting to Oracle.
