Import

Estimated reading: 6 minutes

Partial Import

Fig.1: Partial import

Using the partial import function, it is possible to import individual tables from text files. LIMBAS distinguishes here between its system files and arbitrary text files.

System Files

Files that were created exclusively using the export function in Limbas, are called system files. These consist of a definition file and a data file, which are both packaged in a tar archive. Settings like types, sizes and names of fields are automatically detected for this file type.
The “Append” option allows to append the imported records to an existing table. In this case, a new ID is created. It is also to perform exports and imports between different databases (e.g. PostgreSQL MAXDB).

Text Files

Individual text files can be imported via the item “text file”. Each record must be in one line and each element separated by the same character. The sign for the field separator (e.g. comma) has to be typed into the corresponding “separator” field.
The number selected in “row-preview” also defines how many rows are read by LIMBAS to calculate the length / size of a field to be used. The more rows to be read, the more accurate but slower is the import process. After importing the file, a preview is displayed and for each field, its name, type and description will be detected automatically but can be changed by the user. If the size of a content does not match the length of the related field it will be cut off. In case of doubt, you can define all rows are used for the preview and field size calculation. If you chose “structure”, Limbas creates an empty table with the fields that are detected from the header of the text file, so no data sets are imported.
Furthermore If you want to import UTF-8 files in a non-UTF-8 installation or vice versa, you can select “utf8 en / decode” and the content will be converted automatically. If this is not the case, the option should not be selected because it is otherwise falsely assumed to convert data which is already in the correct format.
Special characters in texts, which would make the import file unusable (such as newlines) may be used according to the following rules:

  • #NEXTLINE# = new line
  • #TAB# = tab
  • #BACKSL# backslash
Fig.2: Text import

A special feature of LIMBAS is the possibility to append data to existing tables. In this case, LIMBAS suggests an allocation of the fields from the text file to those of the tables. However, the field types must match. Texts may for example not be assigned to number fields.

Fig.3: Text import attach

Complete Import

Data which was exported using the LIMBAS complete export feature can be restored easily. The file which is generated from the export has to be stored in the directory ./dependent/BACKUP. Then you can select it from the date selector and import it with a single click on reinstall. Basicly, the complete import works similarly to the partial import for system files, but uses all tables instead of specific ones.
This way it is also possible to make database independent data exchange via exports and imports.

Remote Import

The remote import can be used to import data directly from a separate Limbas installation. It is also possible to import entire connected groups or business objects, such as forms or reports. This feature requires a functioning SOAP connection on both sides.

Fig.4: Remote import

Conversion

The last type of the import feature is the conversion. Conversion imports an existing table from the database so that it is possible to use it in LIMBAS. The idea behind this is also to make it possible to import tables from external programs like Access or ODBC. Similar to the text import, field names and types can be adapted. It is also possible to convert system tables such as the user table “lmb_userdb” so that it can be edited in Limbas. Obviously, no existing fields may be deleted from system tables. However, new fields or links can be added without restrictions.

Fig.5: Conversion

Special fields

Select

Select fields are handled like text fields. Their content is the value of a selection pool and has to be defined as such.

Multiselect

Multiselect fields are links to the tables “lmb_select_d” and “lmb_select_w”. They are not imported because multiple values can be selected. Instead a script has to be written to fill these fields. The content of a table field is the number of linked values and can be calculated using the system tools.

Links are not imported but have to be created afterwards. 1:n links can be created with the link wizzard. For n:m links, a script has to be written in order to write the links into the related link table.

ODBC-Import

With the ODBC import one can import data directly from one of the supported databases.

For this purpose, the connection information must first be specified analogously to the Limbas Installation. After clicking on query you get a list of found tables and views.

Attach Data to Existing Table

If you click on a table in the list and an existing table is selected in the drop-down box, the records of the existing table are attached.

On the left, the fields of the existing table Customers are listed. On the right side you can select the corresponding field of the table to be imported. The data can still be changed during the import by a Extension Function. If no value is to be imported for the respective field, the checkbox can be checked.

These settings can also be saved as a template and then loaded with the next import with a click.

Create new Table

On the other hand, if you want to create a new table, no table can be selected in the dropdown box.

In the upper area you can select name, designation and table group. Below, all fields are listed again. Name, designation, description, type and – for some types – also the size can be set here.

The option structure creates an empty table with the given fields, on the other hand structure and files also import all existing records.