HPlogo ALLBASE/NET User's Guide: HP 3000 MPE/iX Computer Systems > Chapter 3 Using ALLBASE/SQL Through ALLBASE/NET

Using the Preprocessor

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

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.

Feedback to webmaster