To develop and run an application program from the client, the
client must have the following software:
ALLBASE/NET utility program file (NETUtil)
The server must have the following software:
ALLBASE/NET utility program file (NETUtil)
To use the preprocessor, do the following steps:
In the source code, define the DBEnvironment on the server with the alias name:
begin
.
.
.
EXEC SQL CONNECT TO `AliasName';
.
.
.
EXEC SQL RELEASE;
end.
|
You can specify an alias name dynamically by using a host variable.
For example:
EXEC SQL BEGIN DECLARE SECTION;
AliasName: packed array [1..128] of char;
.
.
.
EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO AliasName;
|
Invoke the preprocessor on the client and use the alias name for the DBEnvironment. In the following example, the Pascal preprocessor
is used.
:run psqlpas.pub.sys;info="AliasName"
|
A module is created and stored in the system catalog of the DBEnvironment on the server. The modified source code file and
the four include files created by the preprocessor remain on the client. For more information on preprocessors, refer to the specific
ALLBASE/SQL application programming guide for the language you are using.
Compile and link the modified source file with the necessary libraries on the client as shown in the following example:
where:
sqlout is the modified source code file
someprog is the executable output file
The executable program resides on the client. The program someprog
is now ready to run from the client to access the DBEnvironment on the server.