NAME
dbsort - create a sorted view
SYNOPSIS
Dbptr dbsort ( Dbptr db, Tbl *tbl, int flag, char *name );
DESCRIPTION
Dbsort creates a new view of a database table, sorted
by the fields specified in the
tbl argument, and named
according the name argument. If bit dbSORT_REVERSE of
flag is set, the
sense of the entire sort is reversed. if bit dbSORT_UNIQUE of
flag
is set, then rows which have duplicate keys are eliminated.
The keys must be exactly the same for a row to be eliminated;
keys which compare equal because of overlapping ranges are
not eliminated.
The routine decides if the keys are expressions
by checking for special characters.
If name is zero, then
a name is generated.
EXAMPLE
The following sorts a table by its primary keys.
Tbl *fields ;
Dbptr db ;
.
.
.
dbquery ( db, dbPRIMARY_KEY, &fields ) ;
db = dbsort ( db, fields, 0, 0 ) ;
RETURN VALUES
The return value is a database pointer to the new view of
the table in sort order.
LIBRARY
$(DBLIBS)
SEE ALSO
dbintro(3)
shellsort(3)
AUTHOR
Daniel Quinlan