Subject Re: [IBO] Question on deleting records and "packing"...
Author Lucas Franzen
mlc29150 schrieb:
> Hello everybody,
> My question is may be trivial.
> I'm using DELPHI 7 entreprise, with WinXP(Home edition), the very
> good IBO 4.3, and Firebird 1.03(very good too).
> I'm using an IBOQUERY to delete records from several table of a GDB
> file.
> My code is like this :
> Procedure DELETE_RECORDS(Var MYTABLE : String);
> Begin
> With IBOQUERY1 do
> Begin
> SQL.Clear;
> end;
> END;
> All is OK.

A query is not the appropriate component for executing, it's for fetching.
Use a TIB_DSQL instead of a TIBOQuery.

> But before deleting, the GDB size is 5 MB. After deleting it's still
> 5MB...
> The only one way I've found to reduce the size after deleting is to
> do a backup of the GDB file...May be someone known another way to
> reduce the size with something like the packTable method of Paradox ?

No, there's no other way.
IB/FB is an SQL server, not a many-table-files desktop database.
So: you can't reduce the size without a backup / restore.

But never mind: Allocated pages that are empty after the delete will be
re-used afterwards, so your database won't grow when inserting new
records either.
And it maybe that it's getting faster than before since the database
engine hasn't got to allocate new pages for new records.