--todo 21231.50

--insert into PurgeTable

insert into purgetable
  (purgetable_id,
   tablename,
   description,
   remark,
   whereclause,
   datefieldname,
   plantfieldname,
   systemuser_id,
   timestamp)
  select seq_purgetable.nextval,
         'SortBatch',
         'Sort batches',
         'Only delivered sort batches are purged.',
	 'Status = 5',
         'BatchDate',
         'Plant_ID',
         getminsystemuser(),
         sysdate
    from dual;

commit;