HP 3000 Manuals

Implicit SQL Commands [ HP ALLBASE/4GL Developer Reference Manual Vol. 1 ] MPE/iX 5.0 Documentation


HP ALLBASE/4GL Developer Reference Manual Vol. 1

Implicit SQL Commands 

HP ALLBASE/4GL issues some SQL commands automatically as they are
required.  These commands are:

   *   CONNECT and RELEASE

   *   Cursor commands such as DECLARE CURSOR, OPEN CURSOR, and CLOSE
       CURSOR

   *   BEGIN WORK and COMMIT WORK

CONNECT and RELEASE 

In the developer environment, HP ALLBASE/4GL automatically connects to
the database environment specified for the application when you create or
delete a table from within HP ALLBASE/4GL, or generate an SQL logic
block.

HP ALLBASE/4GL also connects to the application database environment when
you run an application under the application testing mode.  HP
ALLBASE/4GL releases from the database environment automatically at the
end of the session.

At run-time, HP ALLBASE/4GL automatically connects to the database
environment when the user executes a command that accesses the database,
and releases from the database environment at the end of the session.

Cursor Commands 

HP ALLBASE/4GL issues OPEN CURSOR and CLOSE CURSOR commands automatically
during run-time execution of SQL logic blocks.

When HP ALLBASE/4GL generates a SELECT command in an SQL logic block, the
command is converted to a DECLARE CURSOR for SELECT command.  At run-time
the SQL logic block SELECT command initiates an OPEN CURSOR command.

Executing an SQL logic block that opens a cursor on a base table or a
select list automatically closes any cursor that is already open on the
same base table or select list.

BEGIN WORK and COMMIT WORK 

HP ALLBASE/4GL issues an implicit BEGIN WORK command whenever an SQL
logic block is executed or it encounters a TRANSACT *BEGIN command.  In
general, you should include an explicit COMMIT WORK command in an SQL
logic block to commit any work performed in an HP ALLBASE/4GL logic
block.

Any implicit BEGIN WORK issued by HP ALLBASE/4GL invokes the default
repeatable read locking mode.  If you want the transaction to use the
cursor stability locking mode, you must explicitly issue the BEGIN WORK
CS command in an SQL logic block.

HP ALLBASE/4GL issues an implicit COMMIT WORK command whenever it
encounters a TRANSACT *END command in an HP ALLBASE/4GL logic block.

HP ALLBASE/4GL issues an implicit ROLLBACK WORK command whenever it
encounters a TRANSACT *UNDO command in a logic block.

Refer to HP ALLBASE/SQL Transaction Management for more information about
transaction management with HP ALLBASE/SQL.



MPE/iX 5.0 Documentation