SYNOPSISint createindex(ddic, idxfile, indname, table, field, unique, type)
DDIC *ddic;
char *idxfile;
char *indname;
char *table;
char *field;
int unique;
int type;
DESCRIPTION
This function is used to create an index. Ddic is an open DDIC
structure,
which defines the database that contains the table to be indexed. Idxfile
is the filename to use to create the index. If it is not a full path it
will be created in the index directory for the database (default: the same
directory as all the other database files). Indname contains the logical
name of the index. This is the name that is referred to when dropping the
index.
Table and field contain the names of the table in ddic, and the field that are to be indexed. If the last character of the field name is '-' then the index will be a descending index. Unique defines whether the index should be a unique index. Currently the index will be created unique, but no check is currently made when inserting a row.
Type defines what sort of index you want created. The types that are currently know are as follows:
LIKE
, and to provide the searches LIKE3
and LIKER
.
(In SQL "CREATE METAMORPH INDEX ...")
LIKE
and LIKEP
.
(In SQL "CREATE METAMORPH INVERTED INDEX ...")
Returns 0 on success and -1 on failure.
SEE ALSO
createdbtbl()