• Antelope Release 5.10 Linux CentOS release 7.6.1810 (Core) 3.10.0 2020-05-12

 

NAME

dbread_view, dbwrite_view, dbsave_view - read, write and save database views

SYNOPSIS

int dbwrite_view ( Dbptr db, FILE *file );

int dbread_view ( FILE *file, Dbptr *dbr, char *name );

int dbsave_view ( Dbptr db );

DESCRIPTION

Dbread_view reads a view from the specified file pointer. If a name is specified, that name is the name of the new table; otherwise the new table receives a constructed, unique name. Dbwrite_view writes a view to the specified file pointer. Dbsave_view saves a view into the main database directory, and following the standard naming conventions for the database. Such a saved view can be referenced as a regular table later in a different program.

FILES

The new file is created in the same directory as the database, and is named "database.viewname". I.e., in a database "nrdc", a new table named "scv" would be saved into a file "nrdc.scv".

RETURN VALUES

Returns 0 on success, otherwise non-zero.

LIBRARY

$(DBLIBS)

DIAGNOSTICS

SEE ALSO

dbintro(3)
dbwrite_view(3)
dbread_view(3)

BUGS AND CAVEATS

Dbsave_view will overwrite any pre-existing file with the chosen name. Thus, if you name a view "origin", for instance, the real origin table would be overwritten.

Views are only good so long as their constituent tables are unmodified; once a table is modified, the view should be recomputed. Dbread_view checks modification times and will fail to read a view if its constituent tables have been modified.

AUTHOR

Daniel Quinlan
Printer icon