HPlogo ALLBASE/SQL Advanced Application Programming Guide: HP 3000 MPE/iX Computer Systems > Chapter 1 Using the Preprocessor

Syntax Checking Mode

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

In syntax checking mode, the preprocessor checks SQL syntax only. This mode can be useful as you develop the SQL portions of your applications. Preprocessing is quickest in this mode. In addition, you can start debugging your SQL statements before the DBEnvironment itself is in place.

Syntax Checking Mode Syntax Specification

Syntax Checking Mode for C Applications

:RUN PSQLC.PUB.SYS;INFO="(SYNTAX [FLAGGER (FlaggerName)] [ANSI] [THREAD] [])"]

Syntax Checking Mode for COBOL Applications

:RUN PSQLCOB.PUB.SYS;INFO="(SYNTAX [FLAGGER (FlaggerName)] [ANSI] ])"

Syntax Checking Mode for FORTRAN Applications

:RUN PSQLFOR.PUB.SYS;INFO="(SYNTAX [FLAGGER (FlaggerName)] [ANSI] ])"

Syntax Checking Mode for Pascal Applications

:RUN PSQLPAS.PUB.SYS;INFO="(SYNTAX [FLAGGER (FlaggerName)] [ANSI] ])"

Parameters

SYNTAX

causes the preprocessor to only check SQL syntax.

FlaggerName

is the name of the flagger being invoked. At this release FIPS127.1 is the only valid FlaggerName. FlaggerName is not case sensitive. Refer to the "Flagging Non-Standard SQL with the FIPS Flagger" chapter in this manual.

ANSI

preprocesses the application in ANSI mode. The preprocessor generates an SQLCA declaration automatically and implicit updatability is in effect. Refer to the sections "Understanding Implicit Updatability" and "Declaring the SQLCA" in this manual.

THREAD

For C applications only; used to support threaded applications. When specified, the C preprocessor will not generate the #include "SQLVAR" line at the beginning of SQLOUT. The user must insert a #include "SQLVAR" wherever local variables are required to compile and utilize application threads successfully.

Description

  • The preprocessor does not access a DBEnvironment when it is run in this mode.

  • When performing syntax only checking, the preprocessor does not convert embedded SQL statements into constructs for the programming language being used. Therefore the modified source code file does not contain preprocessor generated calls to ALLBASE/SQL external procedures.

  • The include and installable module files are created, but are incomplete.

  • When you invoke the preprocessor with the FLAGGER option, your application must contain an ANSI mode compiler directive in order for the compiler to detect non-standard statements. The following table lists the appropriate directive for each language:

    LanguageDirective
    Cccxl ... ;info='-Aa'
    COBOL$CONTROL STDWARN
    FORTRAN$OPTION ANSI ON$
    Pascal$standard_level 'ANSI'$

Authorization

You do not need ALLBASE/SQL authorization when you use the preprocessor to only check SQL syntax.

Example of Syntax Checking of a C Application



   :FILE SQLIN=CEX2

   :RUN PSQLC.PUB.SYS;INFO="(SYNTAX)"



                                              WED, OCT 25, 1991,  1:38 PM

   HP36216-02A.E1.02              C Preprocessor/3000         ALLBASE/SQL 

   (C)COPYRIGHT HEWLETT-PACKARD CO.   1982,1983,1984,1985,1986,1987,1988,

   1989,1990,1991. ALL RIGHTS RESERVED.



   Syntax checked.

    1 ERRORS     0 WARNINGS

   END OF PREPROCESSING.





   PROGRAM TERMINATED IN AN ERROR STATE.  (CIERR 976)

   :EDITOR

   HP32501A.07.20 EDIT/3000 FRI, OCT 27, 1991,  9:35 AM

   (C) HEWLETT-PACKARD CO. 1985

   /T SQLMSG;L ALL UNN

   FILE UNNUMBERED



                 .

                 .

                 .

   SQLIN                = CEX2.SOMEGRP.SOMEACCT





           SELECT PARTNUMBER, PARTNAME, SALESPRICE INTO :PARTNUMBER, :PARTNAME,

           :SALESPRICE :SALESPRICEIND, FROM PURCHDB.PARTS WHERE PARTNUMBER =

           :PARTNUMBER ;



   ******  ALLBASE/SQL errors (DBERR 10977)

   ******  in SQL statement ending in line 176

   ***     Unexpected keyword.  (DBERR 1006)



   Syntax checked.



    1 ERRORS   0 WARNINGS

   END OF PREPROCESSING.



   /

The line 176 referenced in SQLMSG is the line in SQLIN where the erroneous SQL statement ends.

Feedback to webmaster