| # Table Relations (Import) (daxch0121s000) Use this session to create a relation between LN tables, logical ASCII files, and physical ASCII files per batch in an exchange scheme. Define in the table relation the logical ASCII files to which the data from the LN table must be transferred, and assign a name to the physical ASCII file. You can also run an external program or an LN session as part of an exchange scheme, instead of using the exchange import functionality for a table relation. To create a table relation, do as follows: Enter the sequence number, LN table, logical ASCII file and the physical ASCII file name. Select the Active check box to make the relation active and define an execute condition. Specify under Permitted Operations the actions that are allowed for this table relation, and the appropriate conditions. Select the Stop Condition check box to activate the stop mechanism and define the appropriate stop condition. If you want to use an external program, select the External Program check box and define the program name in the following field. If you want to run an LN session, do not select the check box but enter a session or object code in the following field. Enter the number of the index when one of the ASCII file fields is based on increment. Note The relations on field level are created in the Field Relations (Import) (daxch0522m000) session. Related topics Introduction to the import module To use conditions in the exchange module To use multilevel exchange schemes Relation between logical ASCII files and physical ASCII files Exchange Scheme The exchange scheme code. The exchange scheme is created in the Exchange Schemes (daxch0501m000) session. Batch The batch in an exchange scheme. A batch is created in the Batches (daxch0104m000) session. Table Rel. (Imp.) The identification number of the table relation in the batch during an exchange process. Note The number is increased automatically: when you define a new table relation, LN enters a number of value ten greater than the table relation with the highest value. Sequence Number The sequence number of the table relation in the batch during an exchange process. Sequence numbers are used to indicate the processing order of the table relations in a batch. The sequence number does not have to be unique in a table relation. If two table relations with an identical sequence number are used in a batch, the relation with the lower table relation number is processed first. Note The number is increased automatically: when you define a new table relation, LN enters a number of value ten greater than the table relation with the highest value. Table Enter the code of the table in LN that contains data from the ASCII file during an import procedure. Use multiple table relations to write data from more than one physical ASCII file to one LN table. The LN table name is defined by the package code, a module code and a table number. For example, tcibd001. Related topics Relation between logical ASCII files and physical ASCII files ASCII File Enter the code of the ASCII file, that contains data that must be transferred to an LN table, in an import procedure. To create the field relations of the table relation Automatically, it is necessary that the code of the ASCII file is the same as the code of the LN table. This is an option if you do not have a data definition file of the ASCII file. Note The ASCII file code represents the logical ASCII file. The ASCII code is created in the ASCII Files (daxch0102m000) session. Related topics Introduction to the Exchange module ASCII File Name Enter the name of the physical ASCII file. The entered file name is an extension on the default path. The default path is defined in the field ASCII Files under Paths on the General tab in the Exchange Schemes (daxch0101s000) session. Note This path can also be an absolute path. If that is the case, the default path is not used. The maximum length of the file name is 11 characters. You do not have to generate the import program again if this field is changed. Related topics Relation between logical ASCII files and physical ASCII files Active If this check box is selected, the table relation is active and it can be used for data processing in an import process. If this check box is cleared, the table relations are kept for reference purposes but they are not used during the import process. You can also select this check box if you want to test the exchange scheme, a single table relation, or only a few table relations. Note You do not have to generate the import program again if this field is changed. Execute Condition Execute conditions are used to check whether the table relation must be executed when running the import process. If the Active check box is selected, the execute condition is checked before running the table relation. If the execute condition returns true, the table relation will be executed. If the execute condition returns false, the table relation will be skipped. The Execute condition is executed before the table relation is started, but after the previous table relations have been finished. If the import is based on audit or indicators the Execute Condition is executed at the start of a batch. If the Active check box is selected, but no execute condition is specified the table relation will always be executed when the batch is run. A button is available to generate a new condition or edit the specified condition. If a new execute condition is generated, the condition code will be equal to the ASCII file code with the extension .EXE. Note The condition must be of type Boolean. Whether the import is based on audit or indicators depends upon the check boxes in the Exchange Schemes (daxch0101s000) session and the setting of the batch in the Batches (daxch0104m000) session. Related topics To use conditions in the exchange module Relation between logical ASCII files and physical ASCII files Permitted Operations Add If this check box is selected,, inserts (that is: all records in case of full import, and records having indicator i in case of import based on audit or based on indicators) are imported if the record does not yet exist in the database. If the add condition is empty, all inserts will be processed. If an add condition is specified, only the records that meet the add condition are processed. If this check box is cleared, inserts are not imported. If a record to be inserted is encountered in the ASCII file it will be skipped. Add Condition If a condition is specified, a new record will only be added to the database if the return value of the condition is true. The following preconditions hold when an add condition is executed: Type of action is insert (this is true for all records in case of a full import, and for those records having indicator I, in case of an import based on audit or indicators) All ASCII file fields are filled The record does or does not already exist in the database The keyfields of the target LN table are filled, and other fields contain non-valid values IMPORTANT: In case the record already exists, the add condition is Executed. This is because Exchange first tries to insert the record before checking whether it already exists (for performance reasons). A button is available to generate a new condition, or edit the specified condition. If a new condition is generated the condition code will be equal to the ASCII file code with the extension .ADD. Note This field can only be maintained if Add Record is selected. The condition must be of type Boolean. Whether the import is based on audit or indicators depends upon the check boxes in the Exchange Schemes (daxch0101s000) session and the setting of the batch in the Batches (daxch0104m000) session. Related topics To use conditions in the exchange module Overwrite If this check box is selected,, inserts (that is: all records in case of full import, and records having indicator i in case of import based on audit or based on indicators) are imported if the record already exists in the database. If the add condition is empty, the already existing records are overwritten. If an overwrite condition is specified, existing records are only overwritten if the records to be imported meets the overwrite condition. If this check box is cleared, inserts are not imported if the record already exists in the database. If a record to be inserted from the ASCII file already exists in the database it will be skipped. Overwrite Condition If a condition is specified, an existing record will only be overwritten if the return value of the condition is true. The following preconditions hold when an overwrite condition is executed: If Add Records is selected then the add condition (if any) has already been executed before the overwrite condition is executed. Type of action is insert (this is true for all records in case of a full import, and for the records having indicator 'i' in case of an import based on audit or indicators). All ASCII file fields are filled. The record already exists in the database. The LN table fields are filled with the existing record. A button is available to generate a new condition or edit the specified condition. If a new condition is generated the condition code will be equal to the ASCII file code with the extension .OVR. Note This field can only be maintained if Overwrite Record is selected. The condition must be of type Boolean. Whether the import is based on audit or indicators depends upon the check boxes in the Exchange Schemes (daxch0101s000) session and the setting of the batch in the Batches (daxch0104m000) session. Related topics To use conditions in the exchange module Update If this check box is selected, updates (records having indicator u) are imported. If the update condition is empty, all updates will be processed. If an update condition is specified only the records that meet the update condition are processed. If this check box is cleared, updates are not imported. If a record to be updated is encountered in the ASCII file, it is skipped. Note This field is only relevant when exchanging based on audit or based on indicators. Update Condition If a condition is specified, an update (that is, a record having indicator u) will only be processed if the return value of the condition is true. The following preconditions hold when an update condition is executed: Type of action is update. The primary key fields and the fields that are changed by the update action are filled. The record that must be updated exists in the database. The LN table fields are filled with the existing record. A button is available to generate a new condition or edit the specified condition. If a new condition is generated, the condition code will be equal to the ASCII file code with the extension .UPD. Note This field can only be maintained if Update Record is selected, and it is only relevant in case of an import based on audit or indicators. The condition must be of type Boolean. Whether the import is based on audit or indicators depends on the check boxes in the Exchange Schemes (daxch0101s000) session and the setting of the batch in the Batches (daxch0104m000) session. Related topics To use conditions in the exchange module Delete If this check box is selected, the delete records (those having indicator d) are imported. If the delete condition is empty, all deletes will be processed. If a delete condition is specified, only the records that meet the delete condition are processed. If this check box is cleared, deletes are not imported. If a record to be deleted is encountered in the ASCII file it is skipped. Note This field is only relevant when exchanging based on indicators or based on audit. Delete Condition If a condition is specified, a delete (that is a record having indicator d) will be processed only if the return value of the condition is true. The following preconditions hold when a delete condition is executed: Type of action is delete. All ASCII file fields are filled, including the ones that are not part of the primary key. The record that must be deleted exists in the database The LN table fields are filled with the existing record A button is available to generate a new condition or edit the specified condition. If a new condition is generated, the condition code will be equal to the ASCII file code with the extension .DEL. Note This field can only be maintained if Delete Record is selected, and it is only relevant in case of an import based on audit or indicators. The condition must be of type Boolean. Whether the import is based on audit or indicators depends on the check boxes in the Exchange Schemes (daxch0101s000) session and the setting of the batch in the Batches (daxch0104m000) session. Related topics To use conditions in the exchange module Stop Mechanism If this check box is selected, the import process is stopped if the return value of the stop condition is true. Note You do not have to generate the import program again if this field is changed. Stop Condition The import process is stopped if the return value of the Stop condition is true. If the return value is false, the import process continues with the next batch line. The stop condition is executed at the end of each table relation. You can automatically generate a stop condition. In that case, the stop condition code is the same as the ASCII file code with the extension .STP. This condition is of the Boolean type. Data Access Layer Import via Data Access Layer Select this check box to use the Data Access Layer (DAL) for the current table. By using the DAL, an import carries out all the constraint checks, integrity checks and side effects, such as updates on other tables, that are programmed into the DAL. This guarantees database integrity, saves programming time, and avoids the errors that can occur in condition scripts. Refer to Import using the Data Access Layer (DAL) for details. DAL Property Checks Select this check box to use the Data Access Layer (DAL) property checks. Using property checks is safer, but you can turn them off to boost performance. Refer to Import using the Data Access Layer (DAL) for details. Update Dependent Fields If this check box is selected, the DAL 2 field dependencies are used. When a field is updated, the dependent fields are updated automatically. For details, refer to "DAL2 Field dependencies" in the LN Programmer's Guide. Important! The dependent fields should not be included in the Field Relations (Import). It is recommended to select this check box. User Defined Program External Program If this check box is selected, an external program is used in this table relation. A table relation can perform functions other than importing data. It can also run an external program or a LN session. External programs can be used to correct, update or load multiple LN tables without any user input. If this check box is cleared, a LN session can be used in this table relation. Note You do not have to generate this import program again if this field is changed. Program Name An external program or LN session that is used to bypass the import program. The program is only executable in an active table relation. If you leave this field empty, exchange will activate the table relation during the import process. If you fill in an (external) program, exchange will not take care of importing the ASCII file, but will activate the (external) program instead. The program is activated with a number of arguments. Please refer to the Exchange Scheme Designers information for more details. Note You do not have to generate the import program again if this field is changed. To run the program during an import, make sure this table relation is active by selecting the Active check box. Related topics Exchange scheme designers information Sort on Index Enter an index number of the LN table that is filled with data from the ASCII file. Note The index number is only relevant if one of the ASCII file fields is based on increment. This field allows you to define an increment field on secondary, but unique, indices. Refer to Field Relations (Import) (daxch0122s000) session for more information. Text If this check box is selected, more information is added to the table relation. Click Text to start the text editor. |