Start of change

IFS_UNLINK scalar function

The IFS_UNLINK scalar function deletes an Integrated File System (IFS) stream file.

The function requires that Option 13 (System Openness Includes) of the IBM i operating system is installed.

This function uses the unlink()--Remove Link to File API to delete or unlink the object.

Authorization: See Note below.

Read syntax diagramSkip visual syntax diagram IFS_UNLINK ( PATH_NAME =>  path-name )
The schema is SYSTOOLS.
path-name
A character string containing the path of the file to be unlinked.
The result of the function is an integer. If the unlink is successful, the function returns a value of 0. If the unlink returns an error, the function returns the errno value from the API.

This function is provided in the SYSTOOLS schema as an example of how to embed a C language interface in an SQL scalar function. Similar to other Db2® for i provided tools within SYSTOOLS, the SQL source can be extracted and used as a model for building similar helper functions, or to create a customized version within a user-specified schema.

Services provided in SYSTOOLS have authorization requirements that are determined by the interfaces used to implement the service. To understand the authority requirements, extract the SQL for the service and examine the implementation.

Unlink file /usr/reportdata.txt.

VALUES SYSTOOLS.IFS_UNLINK(PATH_NAME => '/usr/reportdata.txt');
End of change