See also: Reduce SQLite database file size

The SQLite database file may get larger and larger as time goes by. Even if the data is deleted from the database, the database file will not be shrunk, unless you run the VACUUM command. VACUUM will reconstruct the database from scratch and keep the database minimal in size. Thus, it is a recommended good practice to execute VACUUM periodically to reduce the SQLite database file size. But notice that you should use different ways to execute VACUUM for PowerBuilder and PowerServer Mobile.

In PowerBuilder, you can execute the VACUUM command directly, for example:


While in PowerServer Mobile, you will have to use Dynamic SQL Format 1 to execute the VACUUM command, for example:

execute immediate 'vacuum'

Note: before executing VACUUM, make sure the transaction has already been committed, otherwise VACUUM will not be executed successfully.