HP 3000 Manuals

Using the Preprocessor [ ALLBASE/NET User's Guide ] MPE/iX 5.0 Documentation


ALLBASE/NET User's Guide

Using the Preprocessor 

To develop and run an application program from the client, the client
must have the following software:

   *   ALLBASE/NET utility program file (NETUtil)

   *   ALLBASE/SQL software

The server must have the following software:

   *   The Listener

   *   ALLBASE/NET utility program file (NETUtil)

   *   ALLBASE/SQL software

To use the preprocessor, do the following steps:

   1.  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; 

   2.  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. 

   3.  Compile and link the modified source file with the necessary
       libraries on the client as shown in the following example:

            :pasxllk sqlout,someprog  

       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.



MPE/iX 5.0 Documentation