Accessing more than one database
Usually, OSI scripts work on a single data source. In some cases it becomes, however, necessary accessing data from different data sources in one script. A typical case is importing XML data or copying data from another database.
In order to access databases different from the defined data source, dictionary and database must be opened explicitly in the OSI script as shown in the example below).
The topics below will discuss multiple database access for databases referring to the same dictionary, but also to different dictionaries.
DATASOURCE=SAMPLEDAT; // data source must be defined in the ini-file
// alternative: explicite data source definition
//DICTIONARY="e:/odaba/sample.dev";
//DATABASE="e:/odaba/sample.dat";
void main() {
VARIABLES
Dictionary dict;
Database db;
set<VOID> persons;
PROCESS
dict.open("e:/odaba/extdb.dev");
db.open(dict_handle,"e:/odaba/extdb.dat",AccessModes::Write);
persons.open(db_handle,"Person",AccessModes::Read);
//... processing
db.Close();
dict.Close();
};