If you want to delete, insert, or update a series of records, all of the same type, use the CreateSQL or GetSQL functions, then the Execute SQL class method.
SQLExec statements that result in a database update (specifically, UPDATE, INSERT, and DELETE) can only be issued in the following events:
FieldChangeSyntax:SQLExec("Select sum(posted_total_amt) from PS_LEDGERwhere deptid between :1 and :2", DEPTID_FROM, DEPTID_TO, &SUM);
:1 is replaced by the value contained in the record field DEPTID_FROM;
:2 is replaced by the value contained in the record field DEPTID_TO.
&SUM will be assigned value of sum(posted_total_amt) selected.