** Delete the invoice line item records DELETE FROM InvLines; WHERE ivl_Invoice IN; (SELECT ivm_Invoice; FROM InvMast; WHERE ivm_Batch = sBatchId)