Free_deleted

c/c++pascalsql

BOOL [cd_]Free_deleted([cdp_t cdp], ttablenum tablenum);
function [cd_]Free_deleted([cdp : cdp_t]; tablenum : ttablenum) : Boolean;
PROCEDURE Free_deleted(IN tablename CHAR(31))

Parameters

tablenum table number
[cdp client context variable
tablename table name - only in SQL

Description

The Free_deleted function drops all deleted records in the table table. The freed place can be used for new records. Deleted and dropped records cannot be restored later using the Undelete.

The table parameter is the table number get by the Find_object function.

This function won't be executed, if an editable cursor from this table is opened or if another user placed locks on this table. The following Signalize function will display the error "Object is in use" in both cases. Locks placed by the user who is calling this function don't block this function.

If there's no valid record left in the table, the record counter used in the unique default value column will be set to 0.

The Free_deleted function as a procedure is also implemented on server, in order to allow dropping record even from stored procedures and triggers. The table name is used as a parameter. An example (SQL):

CALL Free_deleted("MY_TABLE")
If the Set_sql_option function set the compatibility attribute SQLOPT_EXPLIC_FREE, the record will be dropped immediately after they're deleted so you don't need to use the Free_deleted function at all. This function is mainly used in SQL communication, when the two-step record deleting is not desired.

Default commit is called before and after this function is executed - cannot be rolled back!

Function value

This function returns FALSE if successful, TRUE otherwise. The nature of the error may be told using the Signalize function.

See