CONNX Data Integration Suite 14.8.0 | Concepts | Advanced Features of CONNX | Adabas SQL Gateway Advanced Features | Inserting Data into MU and PE Fields
 
Inserting Data into MU and PE Fields
When the record does not exist
When using a flattened version of the table, you must specify all of the data to be inserted for the entire record using a single SQL statement. This process is straightforward, as each occurrence of a MU or PE field is a separate column.
When using the rotated and root version of the table, several separate insert statements may be required to insert a new record into Adabas.
First, you must insert a record into the root version of the table.
Then, using the ISN returned from the root insert, you insert data into the appropriate rotated tables.
When the record already exists
When using flattened version of the table, the only way to add more occurrences to a given record is to use a SQL update statement. Using the update statement, simply provide a value for the column occurrences you want to add. For example, if a record in the employees table currently has a single occurrence in the LANG MU field, and you want to add a second occurrence, use the following SQL statement (you must know the ISN number of the existing record you want to modify):
update employees set LANG_2 = 'FRE' where ISN_12_11 = 1004
When using the rotated and root version of the table, a SQL insert statement is used to add an occurrence to an existing ADABAS record. Using the same example as above with the rotated version of the tables, the SQL statement would look like this:
insert into employees_lang (ISN_12_11, LANG) values (1004, 'FRE')
Inserting a value into the SQL count fields that return the # of occurrences in a MU/PE will not cause an error. However, the value will be ignored. The number of occurrences will be strictly determined by the amount of data inserted into the MU/PE group.