Mapped Constructs [ HP ALLBASE/SQL PC API User's Guide ] MPE/iX 5.0 Documentation
HP ALLBASE/SQL PC API User's Guide
Mapped Constructs
When you are writing an application against an ALLBASE/SQL database, and
you are using a Gupta Technologies, Inc. 4GL to do so, consider the
following. When there are minor lexical differences in SQL syntax and
logical constructs, PC API automatically translates the SQLBase syntax
into ALLBASE/SQL syntax. These differences are transparent to the
application software. Write SQL statements using the SQL syntax as
defined in your application software documentation. These SQL
differences that are resolved automatically by PC API are called mapped
constructs.
The following SQLBase syntax is automatically translated by PC API into
ALLBASE/SQL syntax:
* Numbered bind variables.
* ROLLBACK and COMMIT statements.
* Comparison operators.
* The ; terminator.
* Warning message on redundant COMMITs.
With each of these mapped constructs, you can use either SQLBase syntax
as documented in the Gupta documentation or ALLBASE/SQL syntax as
documented in the ALLBASE/SQL Reference Manual.
Numbered Bind Variables
A Gupta bind variable in an SQL statement is associated (bound) to
variables defined in a program. SQLBase supports numbered bind variables
(such as :1, :2 ). Although ALLBASE/SQL does not support numbered bind
variables, PC API translates them into ALLBASE/SQL dynamic parameters
before passing the SQL statement to ALLBASE/SQL. An ALLBASE/SQL dynamic
parameter returns either a value or a format. PC API also tracks
numbered bind variables so that the binding process operates correctly.
ROLLBACK and COMMIT Statements
The SQLBase statements ROLLBACK and COMMIT are mapped to ROLLBACK WORK
and COMMIT WORK to meet the requirements of ALLBASE/SQL.
Comparison Operators
ALLBASE/SQL and SQLBase use different symbols to represent comparison
operators. PC API translates SQLBase symbols into their corresponding
ALLBASE/SQL symbols, as shown in Table 6-1 .
Table 6-1. Translation of SQLBase Symbols to ALLBASE/SQL Symbols
----------------------------------------------------------------------------------------------
| | | |
| SQLBase Symbol | ALLBASE/SQL Symbol | Meaning |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| != | <> | NOT EQUAL TO |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| !> | <= | NOT GREATER THAN |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| !< | >= | NOT LESS THAN |
| | | |
----------------------------------------------------------------------------------------------
The ; Terminator
PC API adds a semicolon as required to SQL statements as they are passed
to ALLBASE/SQL.
Warning Message on Redundant COMMIT Statements
When a COMMIT is performed while no transaction is in progress,
ALLBASE/SQL returns a warning message. PC API does not return this
ALLBASE/SQL warning message to the application.
MPE/iX 5.0 Documentation