HPlogo ALLBASE/SQL FORTRAN Application Programming Guide: HP 3000 MPE/iX Computer Systems

Chapter 1 Getting Started with ALLBASE/SQL Programming in FORTRAN

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The steps in creating a FORTRAN application program that accesses an ALLBASE/SQL DBEnvironment are summarized in Figure 1-1 “Creating an ALLBASE/SQL FORTRAN Application Program”.

Figure 1-1 Creating an ALLBASE/SQL FORTRAN Application Program

[Creating an ALLBASE/SQL FORTRAN Application Program]

Using your favorite editor, create FORTRAN source code. The source code is a compilable FORTRAN program or subprogram that contains SQL commands. The SQL commands contained within the FORTRAN program are said to be embedded. Refer to the ALLBASE/SQL Reference Manual for SQL terminology and usage rules.

Before compiling the source code, it must be preprocessed using the ALLBASE/SQL FORTRAN preprocessor. The FORTRAN preprocessor:

  • Checks the syntax of the SQL commands.

  • Stores a module in the system catalog of the DBEnvironment to be accessed at runtime. A module consists of ALLBASE/SQL instructions for executing SQL commands in your program.

  • Creates an installable module file. This file contains a copy of the module stored in the DBEnvironment at preprocessing time. This file can be used to install the module into another DBEnvironment so that the application program can be run in that DBEnvironment.

  • Generates FORTRAN statements for executing the SQL commands and comments out the SQL commands. Non-SQL statements are ignored. This modified version of your source code is placed into a file created by the preprocessor, referred to as a modified source code file.

  • Creates one include file, which contains type declarations and initialization of variables used by the preprocessor generated FORTRAN statements.

The FORTRAN compiler and system linker are used to create the executable program from the modified source code file and the include file. The executable program automatically makes the appropriate database accesses at runtime in DBEnvironments where the related module is stored.