
update t_ai_asstacttype set fstatus = 'D' where fid = 1363798271750862848;

UPDATE t_ai_asstacttype SET fstatus = 'C' WHERE (fid = 1363798271750862848 AND EXISTS (SELECT 1 FROM t_ai_bizvouchersubentry WHERE fflexfield = 'b000044'));

DELETE FROM t_ai_moreasstacttype WHERE (fbasedataid = 1363798271750862848 AND (SELECT fstatus FROM t_ai_asstacttype WHERE fid = 1363798271750862848) = 'D');
DELETE FROM t_ai_standardevententity WHERE (fasstacttypeid = 1363798271750862848 AND (SELECT fstatus FROM t_ai_asstacttype WHERE fid = 1363798271750862848) = 'D');

DELETE FROM t_ai_asstacttype WHERE (fid = 1363798271750862848 AND fstatus = 'D');
