Setting Sculptor and ODBC databases for mirroring

set_mirror_source()

Set Sculptor and ODBC databases for mirroring


SYNTAX

set_mirror_source(sculptor_db, template_db, logfile, options, callback_func)

Define a Sculptor database and the ODBC database which is to automatically synchronised to it. After calling this function, use the mirror command to specify the Sculptor files whose updates are to be mirrored to the ODBC database.

sculptor_db

An explicitly declared database of type DBT_SCULPTOR. To use the default Sculptor database that contains all files declared outside a database declaration, set this argument to NULL. See Declaring an ODBC database.

template_db

The template ODBC database. If this argument is NULL, any existing mirror operation stops.

logfile

The full pathname to a logfile. Errors in the mirror operation are logged to this file. Set to “” if a logfile is not required. Example: “myserver:/home/sculptor/log/mirror.log”

options

Option flags, defined in sculptor.h. Multiple flags are combined with the | operator. Only one flag is currently implemented:

MIRROR_RECREATE_LOGFILE

Forces a new, empty logfile. If not set, error messages are appended to an existing logfile and a new logfile is created only if one does not already exist.

callback_func

If not NULL, this is a Sculptor function that gets called automatically, once, if Sculptor loses its connection to the mirror database. The function is called with one argument, the mirror database object.

EXAMPLE:

-database mirrordb {
     type = DBT_ODBC
     ...
}
      set_mirror_source(NULL, mirrordb, "myserver:c:/sclog/mirror.log, 0, MirrorError)

 !function MirrorError(db){
      info "Mirror failed to database " + nameof(db)
 }

For detailed examples of mirroring operations, see Mirroring a Sculptor database to ODBC.


RELATED TOPICS

ODBC

Mirroring a Sculptor database to ODBC

mirror

ODBC related defines in sculptor.h