HP 3000 Manuals

Ch 4. ALLBASE/SQL Preprocessors [ ALLBASE/SQL Quick Reference Guide ] MPE/iX 5.0 Documentation


ALLBASE/SQL Quick Reference Guide

Chapter 4  ALLBASE/SQL Preprocessors 

C Preprocessor 

Invocation 

Syntax Checking Mode.   

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

Full Preprocessing Mode.   

                                 [ {MODULE(ModName)  }      ]
                                 [ {OWNER(OwnName)   }      ]
:RUN PSQLC.PUB.SYS;INFO="DBEName [({{DROP {PRESERVE}}}|...|)]"
                                 [ {{     {REVOKE  }}}      ]
                                 [ {{               }}      ]
                                 [ {{NODROP         }}      ]
[REV BEG]

Static Conversion Mode.   

:RUN PSQLC.PUB.SYS;INFO="(DYNAMIC [MODULE (ModName)] |...| )"
                                  [OWNER (OwnName) ]
[REV END]

Preprocessor Input and Output 

----------------------------------------------------------------------------------------------
|                           |                           |                                    |
|         File Type         |  User Supplied FileName   |          Default Filename          |
|                           |                           |                                    |
----------------------------------------------------------------------------------------------
|                           |                           |                                    |
| Input to the C            | Use file equation         | SQLIN                              |
| Preprocessor              |                           |                                    |
|                           |                           |                                    |
----------------------------------------------------------------------------------------------
|                           |                           |                                    |
| ALLBASE/SQL Message       |                           | SQLCT000.PUB.SYS                   |
| Catalog                   |                           |                                    |
|                           |                           |                                    |
----------------------------------------------------------------------------------------------
|                           |                           |                                    |
| Preprocessor Message File | Use file equation         | SQLMSG                             |
|                           |                           |                                    |
----------------------------------------------------------------------------------------------
|                           |                           |                                    |
| Modified C Source Code    | Use file equation         | SQLOUT                             |
| File                      |                           |                                    |
|                           |                           |                                    |
----------------------------------------------------------------------------------------------
|                           |                           |                                    |
| Constant Declaration File | Use file equation         | SQLCONST                           |
|                           |                           |                                    |
----------------------------------------------------------------------------------------------
|                           |                           |                                    |
| Variable Declaration File | Use file equation         | SQLVAR                             |
|                           |                           |                                    |
----------------------------------------------------------------------------------------------
|                           |                           |                                    |
| Type Declaration File     | Use file equation         | SQLTYPE                            |
|                           |                           |                                    |
----------------------------------------------------------------------------------------------
|                           |                           |                                    |
| External Procedure File   | Use file equation         | SQLEXTN                            |
|                           |                           |                                    |
----------------------------------------------------------------------------------------------
|                           |                           |                                    |
| Installable Module File   | Use file equation         | SQLMOD                             |
|                           |                           |                                    |
----------------------------------------------------------------------------------------------

Files are created in the current group and account.

C Declarations for ALLBASE/SQL Data Types 

-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| ALLBASE/SQL Data  |            Description             |       C Declaration[REV BEG]       |
|       Type        |                                    |                                    |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| BINARY(1)         | single binary byte                 | sqlbinary or sqlbinary[1]          |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| BINARY(n)         | fixed length binary string         | sqlbinary[n]                       |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| VARBINARY(n)      | variable length binary string      | sqlbinary[n/4 + 1][REV END]        |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| LONG BINARY       | descriptor string for long column  | char[96]                           |
|                   | data                               |                                    |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| LONG VARBINARY    | descriptor string for long column  | char[96]                           |
|                   | data                               |                                    |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| CHAR(1)           | single byte                        | char                               |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| CHAR(n)           | fixed length character string      | char[n+1]                          |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| VARCHAR(n)        | variable length character string   | char[n+1]                          |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| DECIMAL           | up to 15 digits plus sign          | double                             |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| REAL              | floating point                     | float                              |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| FLOAT             | double precision floating point    | double                             |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| INTEGER           | binary integer--31 bits plus sign  | int                                |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| SMALLINT          | binary integer--15 bits plus sign  | short                              |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| DATE              | 10-character date                  | char[11]                           |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| TIME              | 8-character time                   | char[9]                            |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| DATETIME          | 23-character timestamp             | char[24]                           |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------
|                   |                                    |                                    |
| INTERVAL          | 20-character interval              | char[21]                           |
|                   |                                    |                                    |
-----------------------------------------------------------------------------------------------

Compatibility of ALLBASE/SQL and C Data Types 

-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
|                     |    char     |   char[n]   |  short or   | int, long,  |   double    |    float    |
|                     |             |             |  shortint   | or longint  |             |             |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| BINARY(n)           |      C      |      C      |      I      |      I      |      I      | I[REV BEG]  |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| VARBINARY(n)        |      I      |      I      |      C      |      C      |      I      | I[REV END]  |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| CHAR(1)             |      E      |      C      |      I      |      I      |      I      |      I      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| CHAR(n)             |      C      |      E      |      I      |      I      |      I      |      I      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| VARCHAR(n)          |      C      |      C      |      I      |      I      |      I      |      I      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| DECIMAL             |      I      |      I      |      C      |      C      |      C      |      C      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| REAL                |      I      |      I      |      C      |      C      |      C      |      E      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| FLOAT               |      I      |      I      |      C      |      C      |      E      |      C      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| INTEGER             |      I      |      I      |      C      |      E      |      C      |      C      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| SMALLINT            |      I      |      I      |      E      |      C      |      C      |      C      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| DATE                |      C      |      C      |      I      |      I      |      I      |      I      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| TIME                |      C      |      C      |      I      |      I      |      I      |      I      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| DATETIME            |      C      |      C      |      I      |      I      |      I      |      I      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------
|                     |             |             |             |             |             |             |
| INTERVAL            |      C      |      C      |      I      |      I      |      I      |      I      |
|                     |             |             |             |             |             |             |
-----------------------------------------------------------------------------------------------------------

E=Equivalent     C=Compatible     I=Incompatible



MPE/iX 5.0 Documentation