Syntax
INSERT insertable [ (<mapping> [ & <mapping> [ …n ] ] ) ] <mapping> := insertable = class_name
Parameters
Insert can be abbreviated as INS.
insertable
An insertable class.
mapping
Maps an attribute referenced by the insertable class to the attribute as referenced by the current class. Refer to Mapping for more information.
Description
The Insert logic command inserts an insertable class into the current class.
If an Insert logic statement in an ispec or Report is removed, any attributes associated with the insertable class specified by the Insert logic command are also removed. Ensure that profile members of the ispec do not depend on these attributes.
Restrictions
The following restriction applies to the use of the Insert logic command:
Insertable classes cannot be inserted into other insertable classes.
INSERT statement can be used on the Insertable class or an attribute that has the same name as the insertable class and inherited from the insertable class.
For example, an Ispec1 has Attribute1 that inherits from Insertable1. Ispec1.Main () contains logic as below:
Insert Attribute1
AB Suite throws an error during validation as follows:
‘Attribute1 cannot be inserted. INSERT statement can only insert an Insertable class.’
You can resolve the error as follows:
Rename Attribute1 to Insertable1 and change the logic of Ispec.Main() as:
Insert Insertable1
Or
Change the logic of Ispec1.Main () method as:
Insert Insertable1
Example
Insert Deduct