Export to Database

Users can export datasets or other data structures to a database. Rulex Factory makes this operation possible by using the Export to Database task.

The Export to Database task is divided into two tabs:


The Options Tab

As mentioned in the Export Overview page, the Options tab contains:

  • the Location Controller, whose description is provided in the Export Overview page.

  • the File options, which contains all the same options for all export tasks, except for the File basename, whose details are provided below.

File basename

In the File Basename pane, users can set and configure the following options:

  • Table basename: users can type the name they want their database table to have.

  • Bulk size for insert: through this option, users can retrieve blocks of data of the specified size.


The Advanced tab

The Advanced tab is divided into four panes:

Available Attributes

Within this pane, users will find a list of all the dataset’s attributes. To search for a specific attribute, use the lens icon at the top right of the panel. Users also have the option of sorting the attributes according to their preferences. They can choose from a drop-down list of the Order by option:

  • Attribute

  • Name

  • Type

  • Ignored

  • Role

Mode

Within this pane, users can set and find the following options:

  • Insert mode: users here can specify the type of export that will be performed. They can choose between:

    • Insert (with drop): if selected, it will delete the existing table and recreate it with the data users are exporting.

    • Insert (append): if selected, it will add rows to the existing table containing the data users are exporting.

    • Update: if selected, the data users are exporting to update existing data are going to be used, based on column matches specified by key attributes.

    • Delete: if selected, the data in the existing table that matches the imported data, according to the specified key attributes, will be deleted.

  • Add increment primary key: if selected, a column is added to the exported table with an incremental number as a primary key. On the right of this checkbox, users will find an edit box, which allows them to define the primary key column.

  • Use also missing values in conditions on key variables: If selected, missing values in key attributes in the dataset lead to conditions on NULL. Basically, this means that “missing” is a condition to be met, and not simply the absence of a value. Likewise, if not selected, any missing values will simply not be considered as conditions for any successive operations performed on the dataset.

  • Use input rules to determine conditions: if selected, input rules are used to determine query conditions instead of key attribute values.

Key attributes

Within this pane, users can set the attributes they want to use as key attributes. This operation can be done via a Manual List (users need to manually drag & drop the selected attributes onto the pane) or via a filtered list.

Exported attributes

Within this pane, users can set the attributes to be exported from the Available attributes list pane. If left empty, all attributes are exported. This operation can be done via a Manual List (users need to manually drag & drop the selected attributes onto the pane) or via a filtered list.


Example

  • Drag an Export to Database task onto the stage and connect to a Data Manager.

  • Configure its access parameters, as explained in the Database Resources.

    Select the file location of the downloaded file.

https://cdn.rulex.ai/docs/Factory/export-db-ex1.webp
  • Select what you want to export in the Data to be exported pane and type a name for the new table in the Table basename text box. Save and compute the task.

https://cdn.rulex.ai/docs/Factory/export-db-ex2.webp