sp_iqemptyfile Procedure

Empties a dbfile and moves the objects in the dbfile to another available read-write dbfile in the same dbspace. Not available for files in an RLV dbspace.

Syntax

sp_iqemptyfilelogical-file--name )

Privileges

Requires at least one system privilege from each group:

Group 1 Group 2
BACKUP DATABASE INSERT ANY TABLE
SERVER OPERATOR UPDATE ANY TABLE
ALTER DATABASE DELETE ANY TABLE
  ALTER ANY TABLE
  LOAD ANY TABLE
  TRUNCATE ANY TABLE
  ALTER ANY OBJECT

Users without the required system privileges must be granted EXECUTE permission to run the stored procedure.

Description

sp_iqemptyfile empties a dbfile. The dbspace must be read-only before you can execute the sp_iqemptyfile procedure. The procedure moves the objects in the file to another available read-write dbfile in the same dbspace. If there is no other read-write dbfile available, then SAP Sybase IQ displays an error message.

Note: In a multiplex environment, you can run sp_iqemptyfile only on the coordinator. There must be one read-write dbspace available for the procedure to succeed.
If the dbfile is in an RLV dbspace, then this error message displays:
Cannot empty files in an rlv store dbspace. 

Example

Empties dbfile dbfile1:
sp_iqemptyfile 'dbfile1'