Was this helpful?
DelEmp Procedure
The DelEmp 4GL procedure isolates the deletion of records from the Emp and Tasks tables within the application to control the logical relationships between data in separate tables. Data is deleted within a transaction to ensure that the database is left in a logically consistent state.
/* Delete an Employee and all that */
/* employee's tasks from the database */
procedure del_emp (empname=varchar(20)) =
begin
message 'Deleting employee ' + empname +
        '.  .  .';
delete from tasks where name = :empname;
delete from emp where name = :empname;
delete from dependents where name = :empname
commit;
end
Last modified date: 11/28/2023