Dbdelete()

From Recital Documentation Wiki
Revision as of 15:58, 3 April 2009 by Yvonnemilne (Talk | contribs)

Jump to: navigation, search

PURPOSE

logically delete a record


SYNOPSIS

#include "dbl.h"
 
	int	dbdelete(dbf, recno)
 
	<input parameters>
 
	char	*dbf;		/* .DBF file descriptor */
	long	recno;	/* Record number */
 
	<output parameters>
	none


RETURN VALUE

The dbdelete() function returns 0 for success, or <0 if an error occurs. See the section on return code values for a detailed list of return codes.


DESCRIPTION

This function deletes the record logically, i.e., it marks the record deleted while physically the record remains in the .DBF file.


EXAMPLE

This example marks 20 records in a .DBF file whose file descriptor is in "char *dbf" deleted and reports the successful deletion on the standard output.

#include "dbl.h"
 
	char	*dbf;		/* File descriptor */
	int	i;		/* Counter */
	int	rc;		/* Return code */
	for (i = 0; i < 20 ; ++i) {
		rc = dbdelete(dbf, i);
		if (rc = = SUCCESS) printf("%d record deleted \n", i);
		else {
			printf("error number %d \n", rc);
			exit (1);
		}
	}


SEE ALSO

dbflush(), dbgetnr(), dbgetr(), dbgetrk(), dbrecall(), dbrmvkey(), dbrmvr(), dbdo()