Deletes the record(s) in the Base Table associated with the group where this command is specified.
Delete
This command is used to delete records in the
Base Table associated with the group where the
Delete command itself is specified.
This command can only be used in a
For Each command defined in a
Procedure. The deletion is executed at the exact moment it is found, unless the For each command has a
Blocking clause. In this last case, the current deletion will happen when the entire block is completed and the Delete command is sent to the DBMS for a bulk deletion.
Notes:
Given the Transaction objects:
PurchaseOrder
{
PurchaseOrderId*
PurchaseOrderDate
SupplierId
PurchaseOrderAmount
}
PurchaseOrderDetail
{
PurchaseOrderId*
PurchaseOrderDetailId*
PurchaseOrderDetailQuantity
PurchaseOrderDetailPrice
PurchaseOrderDetailAmount
}
1) In the following example, purchase order lines are deleted before the purchase order header. So, there would be no purchase order lines left without a header if the program were to cancel.
For each PurchaseOrder //As the base trn is PurchaseOrder the deletion will be perfomed in the PurchaseOrder table
For each PurchaseOrderDetail //As the base trn is PurchaseOrderDetail the deletion will be perfomed in the PurchaseOrder table
Delete
Endfor
Delete
EndFor
2) The following example, deletes a specific purchase order received by parameter.
Procedure Rule:
Parm(&PurchaseOrderId);
Procedure Source:
For each PurchaseOrder //As the base trn is PurchaseOrder the deletion will be perfomed in the PurchaseOrder table
where PurchaseOrderId=&PurchaseOrderId
For each PurchaseOrderDetail //As the base trn is PurchaseOrderDetail the deletion will be perfomed in the PurchaseOrder table
Delete
Endfor
Delete
EndFor
Database update through procedures