NAME
dbcopy - copy records from one table to another
SYNOPSIS
#include "db.h" ;
int dbcopy(Dbptr dbin, Dbptr dbout,
Arr *expressions)
DESCRIPTION
dbcopy copies rows from one table
dbin to another table
dbout field by field.
For each field in the
dbout record, if
expressions is not zero,
dbcopy first checks for an expression in the
array
expressions. If present, this expression is evaluated against
the corresponding
dbin record. Otherwise,
dbcopy checks for a field of the
same name in the
dbin record. If no corresponding field is found, the output
record keeps the null value for that field.
The input database pointer is interpreted as a range of records, from
dbin.record up to dbin.field. If dbin.field is dbALL,
the entire input table is copied.
RETURN VALUES
dbcopy returns the record number of the first added record, or
a negative value if an error occurs.
LIBRARY
$(DBLIBS)
DIAGNOSTICS
SEE ALSO
dbconvert(1)
BUGS AND CAVEATS
Differences in null values are not properly translated.
Should have a more efficient mode when input and output are the
same schema and table, and there are no expressions.
AUTHOR
Daniel Quinlan