Difference between revisions of "Dbdcache()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 41: Line 41:
  
 
rc = dbsize(dbf, &dbsize);
 
rc = dbsize(dbf, &dbsize);
if (rc = = SUCCESS) dbdcache(dbsize);
+
if (rc == SUCCESS) dbdcache(dbsize);
 
else {
 
else {
 
printf("error number %d \n", rc);
 
printf("error number %d \n", rc);

Latest revision as of 12:48, 1 May 2009

PURPOSE

specify the database cache size


SYNOPSIS

#include "dbl.h"
 
	int	dbdcache(size)
 
	<input parameters>
 
	int	size;		/* Database cache size in records */
 
	<output parameters>
	none


RETURN VALUE

The dbdcache() function returns 0 for success. See the section on return code values for a detailed list of return codes.


DESCRIPTION

The dbdcache() function specifies the amount of records to be cached in memory.


EXAMPLE

This example sets the database cache to the total number of records stored in the database specified in the file descriptor stored in "char *dbf".

#include <dbl.h
	char	*dbf;		/* .DBF file descriptor */
	long	dbsize;	/* Size of the .DBF file */
	int	rc;		/* Return code */
 
	rc = dbsize(dbf, &dbsize);
	if (rc == SUCCESS) dbdcache(dbsize);
	else {
		printf("error number %d \n", rc);
		exit (1);
	}


SEE ALSO

dbflush(), dbgetnr(), dbgetr(), dbgetrk(), dbicache(), dbrecall()