HPlogo ALLBASE/SQL Advanced Application Programming Guide: HP 9000 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

psqlc -s [-i SourceFileName ] [-p ModifiedSourceFileName ] [-f FlaggerName ] [-a ] |...|

Syntax Checking Mode for COBOL Applications

psqlcbl -s [-i SourceFileName ] [-p ModifiedSourceFileName ] [-f FlaggerName ] [-a ] |...|

Syntax Checking Mode for FORTRAN Applications

psqlfor -s [-i SourceFileName ] [-p ModifiedSourceFileName ] [-f FlaggerName ] [-a ] |...|

Syntax Checking Mode for Pascal Applications

psqlpas -s [-i SourceFileName ] [-p ModifiedSourceFileName ] [-f FlaggerName ] [-a ] |...|

Parameters

-s

causes the preprocessor to only check SQL syntax.

-i SourceFileName

identifies the name of the input file containing the source code to be preprocessed. If a SourceFileName is not specified, a file by the name of sqlin is assumed.

-p ModifiedSourceFileName

identifies the name for the modified source code file. If a name is not specified, the preprocessor generated code is written to a file with the same name as SourceFileName with an appended suffix.

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

-a

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.

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 -f 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
    Ccc -Aa
    COBOLcob -C ANS85
    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

   $ psqlc -s -i mysource



                                             MON, JUL 10, 1991,  4:48 PM

   HP36217-02A.E1.00           C Preprocessor/9000           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.



   $ more sqlmsg

                                             MON, JUL 10, 1991,  4:48 PM

   HP36217-02A.E1.00           C Preprocessor/9000           ALLBASE/SQL 

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

   1989,1990,1991. ALL RIGHTS RESERVED.





          SELCT PartNumber, PartName, SalesPrice

            INTO :PartNumber, :PartName :PartNameInd,

            :SalesPrice :SalesPriceInd FROM PurchDB.Parts

            WHERE PartNumber = :PartNumber;



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

   ****** in SQL statement ending in line 128

   ***    <1001> Syntax error.  (DBERR 1001)



   Syntax checked.



     1 ERRORS   0 WARNINGS

   END OF PREPROCESSING



The line 128 referenced in sqlmsg is the line in mysource where the erroneous SQL statement ends.
Feedback to webmaster