Loading Data Programmatically - Intergraph Smart Materials - Version 10.2 - Help - Hexagon

Intergraph Smart Materials Classic Help

Language
English
Product
Intergraph Smart Materials
Subproduct
Classic
Search by Category
Help
Smart Materials/Smart Reference Data Version
10.2

The call specification for the m_pck_omi_custom.omi_load CIP procedure looks like the following:

PROCEDURE omi_load

(p_omij_id IN m_omi_import_jobs.omij_id%TYPE);

The only parameter that is necessary is the internal job ID. You must insert this value into the omij_id column as you fill the interface table with your program, because the OMI main program uses this ID to identify all the records that belong to the job being executed. You must make sure that you issue a database commit when your procedure is finished. The framework for a possible implementation is outlined in the included comment section; please be sure to take into account the assumptions and prerequisites described in that comment if you are going to implement your own loading code.

After your procedure has been called, the OMI main import program takes control. The program expects to find the interface table filled; all records are subject to the same processing rules and the same validations as if the table had been filled by SQL*Loader. To the main program, it is totally transparent which method was used to supply the input data.

Please be especially aware of the fact that the sequence in which you insert records here is absolutely crucial to the main import program: you must use the m_seq_import_interfaces_rowcnt database sequence to supply values for the seq_id column, because the OMI main program processes the input records in the order of this column value.

You will most likely have to implement the actual INSERT statement in the center of several nested loops that will have loop code for each of the levels that make up the BOM hierarchy. In other words, an outer loop may control creation of structure records (NODE_BEGIN, NODE) from a tree walk type of query; for each such structure record, an inner loop will handle the structure detail data such as NODE_NLS and NODE_A records. Furthermore, for each node with BOM positions, another set of nested loops should handle the position records, and for each position record, all the variable position attributes. You must take care that before you insert the first position record for any node, you must supply a valid discipline reference by using a DISC record type. You can change position discipline assignments as often as it is needed, even in the context of the same node.