• Antelope Release 5.10 Linux CentOS release 7.6.1810 (Core) 3.10.0 2020-05-12

 

NAME

dbdestroy, dbtruncate - delete databases, truncate database tables

SYNOPSIS

#include "db.h" ;

int dbdestroy(Dbptr db)

int dbtruncate(Dbptr db, long nrecords)

DESCRIPTION

dbdestroy completely eliminates every table in a database. dbtruncate truncates a database table, shortening it to the specified number of records.

RETURN VALUES

dbdestroy returns 0 for success, dbINVALID if any failures occur. It fails if the database was opened read-only, or if any of the database tables cannot be removed. It does not inspect the permissions of the database tables themselves, only the directories.

dbtruncate returns 0 for success, dbINVALID if a failure occurs.

In case of errors, more verbose error messages are left on the error register.

LIBRARY

$(DBLIBS)

DIAGNOSTICS

SEE ALSO

dbintro(3)
register_error(3)

BUGS AND CAVEATS

dbdestroy should only be used at the end of a program; further attempts to access the database tables may result in segmentation violations. dbdestroy does not eliminate external files referenced by the database.

AUTHOR

Daniel Quinlan
Printer icon