num_cierre:=DM2.IBDataSet_CierreZID_CIERREZ.Value;
DM2.IBDataSet_CierreZ.Post;
with(dm.IBQuery_general)do
begin
FieldDefs.Clear;
SQL.Clear;
SQL.Add('update facturas_de_ventas set id_cierrez=:cierre where id_cierrez is null');
ParamByName('cierre').AsInteger:=num_cierre;
execsql end;