Subject | Re: [IBO] Question on deleting records and "packing"... |
---|---|
Author | Lucas Franzen |
Post date | 2004-01-19T15:04Z |
mlc29150 schrieb:
A query is not the appropriate component for executing, it's for fetching.
Use a TIB_DSQL instead of a TIBOQuery.
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.
Luc.
> Hello everybody,No.
>
> 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);
> Const INST_DELETE='DELETE FROM %s';
> Begin
> With IBOQUERY1 do
> Begin
> SQL.Clear;
> SQL.Add(FORMAT(INST_DELETE,[MYTABLE]));
> EXECSQL;
> 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.
>No, there's no other way.
> 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 ?
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.
Luc.