Using NS3000/iX Network Services (36920-90008)

64 Chapter 4
Remote Database Access
RDBA Access Methods
RDBA Access Methods
There are three ways to open a remote TurboIMAGE database within a
program:
Identify the database as a remote file in a prior FILE command; for
example, FILE dbname=dbname:envID;
Use the COMMAND intrinsic to include the FILE command
information in your program
Create a database-access file that supplies the command, a DSLINE
command, and a REMOTE HELLO command.
When the file specified in a FILE command is a remote database, the
syntax (for the first two methods) is the same as it is for a remote file;
you can specify the location of the database in the formal or actual
designator or in the DEV= option. When using the third method,
creating a database-access file, the FILE command may specify a
remote database location only in the DEV= option — not in the formal or
actual designator. (For details see the description of the FILE command
in the “Remote File Access” chapter of this manual.)
With all three access methods you must call the DBOPEN intrinsic
within the program to open the remote database. In the first two cases
you call DBOPEN with the database root file name supplied in the FILE
command. In the third case you use the database-access file name.
In the first case a user needs to know the location of the database. The
application program that accesses the database does not need to have
this information. The second case embeds the information in the
application and frees the user from the responsibility of knowing the
location. The third case insulates both the user and the application
program from the information.
The COMMAND intrinsic allows a program to execute MPE/iX commands.
The first parameter of the intrinsic is a string of characters giving a
specific command. You can issue a series of COMMAND calls within your
program to establish a remote session (DSLINE and REMOTE HELLO
commands) and identify the remote database (FILE command). You can
then call DBOPEN to open the database. When you have called DBCLOSE
to close the remote database, you must call COMMAND again to execute
REMOTE BYE and DSLINE;CLOSE commands. See the MPE/iX
Intrinsics Reference Manual for a detailed explanation of the COMMAND
intrinsic.
A database-access file contains a FILE command, a DSLINE command,
and one or more remote logon commands. When you call DBOPEN with
the name of this file, the remote session is established and the remote
database is opened. You can then call other TurboIMAGE intrinsics to
perform the desired operations upon the database.