Difference between revisions of "Dbicache()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 41: | Line 41: | ||
if (rc = = SUCCESS){ | if (rc = = SUCCESS){ | ||
rc = dbicreat("person.ndx", "SSN", 10, 'C'); | rc = dbicreat("person.ndx", "SSN", 10, 'C'); | ||
− | if (rc = = SUCCESS){ | + | if (rc == SUCCESS){ |
printf("index person created \n"); | printf("index person created \n"); | ||
} else { | } else { |
Latest revision as of 13:19, 1 May 2009
PURPOSE
specify size of the index cache
SYNOPSIS
#include "dbl.h" int dbicache(size) <input parameter> int size; /* Index cache size in blocks */ <output parameters> none
RETURN VALUE
The dbicache() 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
The dbicache() function is used to specify the size of the index cache in 512 byte disk blocks. Index caching improves performance of index operations.
EXAMPLE
The following example sets the icache (index cache) to 100 then creates an .NDX file "person.ndx" whose key expression, length and type are "SSN", 10 and 'C' respectively. "SSN" is a field name of the associated .DBF file.
#include "dbl.h" int rc; /* Return code */ rc = dbicache(100); if (rc = = SUCCESS){ rc = dbicreat("person.ndx", "SSN", 10, 'C'); if (rc == SUCCESS){ printf("index person created \n"); } else { printf("error number %d \n", rc); exit (1); } } else { printf("error number %d \n", rc); exit (1); }