isc_drop_database()

From InterBase

Go Up to API Function Reference


Deletes a currently attached database and all of its supporting files, such as secondary database files, write-ahead log files, and shadow files.

Syntax

 ISC_STATUS isc_drop_database(
 ISC_STATUS *status_vector,
 isc_db_handle *db_handle);
Parameter Type Description

status_vector

ISC_STATUS *

Pointer to the error status vector

db_handle

isc_db_handle *

Pointer to a database handle set by a previous call to ­isc_attach_database(); the handle identifies the database containing the array column.

db_handle returns an error in status_vector if it is NULL.

Description

isc_drop_database() deletes an attached database and all of its supporting files. Call this routine when you no longer have a use for the database (for example, if you moved all the data into another database, or if the database was just temporary and is no longer needed). To succeed, isc_drop_database() must be issued when no other processes are attached to the database.

Example

The following conditional statement drops a database:

if (handle)
isc_drop_database(status_vector, &handle);

Assuming that handle is valid and identifies an attached database, the specified database is dropped when this statement executes.

Return value

isc_drop_database() returns the second element of the status vector. Zero indicates success. A nonzero value indicates an error. For InterBase errors, the first element of the status vector is set to 1, and the second element is set to an InterBase error code.

To check for an InterBase error, examine the first two elements of the status vector directly. For more information about examining the status vector, see Handling Error Conditions.

See Also

Advance To: