Working with DB to Local File Process
Process Purpose
The DB to Local File process is used to export data (select records) from a database table located in a specific Host server into a data file.
This data source must always be connected/linked to the operating system being used. See To create a Data Source in the PC.
When you add a process, you are required to define its settings. This occurs in the process's properties window which is displayed automatically after having added the DB to Local File process. This properties window is constituted by three tabs - "General", "Query" and "Advanced".
If any subsequent edition is required, double-click the process to open its properties window and enter the necessary modifications.
General tab
Fill in the following options:
Host Name |
|
Host Name |
Select a Host profile from the drop-down list or click |
Data Source |
Select the database that includes the records to be exported from the drop-down list or click |
Select … From … |
|
Table Name |
Select the table that includes the records to export from the drop-down list. If needed, click |
Local File |
Select the data file that will receive the exported records from the drop-down list. If needed, click |
Max. Record |
Define the maximum number of records to select and export. |
Local Field Name column |
Select the data file fields that will receive the records from the drop-down list. |
DB Field Name or Value(s) column |
Define the table field name or value to export. Either define a fixed name/value or click See Variable Definition. |
Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.
Example
The selected export source is the "Inventory" database, more specifically, the "Items" table (the value(s) within the "ItemNumber" and "ItemDescription" table fields). The exported data will be inserted in the local file "<Inv>"(in the "<Product>" and "<Description>" fields). |
Continue to the "Query" tab.
Query tab
Proceed as follows:
Where |
|
Where Clause |
Click |
Order By |
|
DB Filed Name |
Define the result order by selecting the fields of the selected table from the drop-down list. |
Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.
Proceed to the "Advanced" tab.
Advanced tab
SQL request name (Must be unique) |
|
SQL User Name |
Define a unique name for the SQL request. One is always suggested. |
Store Nbr of Record(s) in Variable |
|
Variable |
Click |
Specific Record Formating |
|
Record Format |
Define the mask of the selected record. |
If … Go to |
|
No Record |
Select a target location from the drop-down or |
ODBC Error |
Select a target location from the drop-down or |
Com. Error |
Select a target location from the drop-down or |
Detail of a window:
"S:Menu" is a screen included in the same program as the process.
"R:Routine_1" is a routine included in the same program as the process.
If required, use the icons on the top of the properties window:
Click it to setup a timeout. See To Define a Time Out.
Click it to create a new data file. See Creating a Data File.
Click it to edit a data file. See Editing a Data File.
use it to test SQL Scripts. See To Test SQL Scripts.
After filling in the required options, click to conclude or
to abort the operation.
The added process is displayed in the corresponding "Actions" tab or "Process" window.
You can use relative paths to refer the file(s) you want to use in your project. See Working with Aliases.
Use the right click in MCL-Designer's input boxes to access certain features regarding the input box's option as well as general actions such as "Copy"; "Paste"; "Search".
Ex: If you right-click the "Variable" input box (included in a "Conversion's" properties window), you are provided with the "Search..."and "Variable Select" options.
If you right-click another input box, it will provide other possibilities.