HP 3000 Manuals

SQL Commands [ HP ALLBASE/4GL Developer Quick Reference Guide ] MPE/iX 5.0 Documentation


HP ALLBASE/4GL Developer Quick Reference Guide

SQL Commands 

The following list shows some of the SQL commands that you are permitted
to use in HP ALLBASE/4GL SQL logic blocks.  These SQL commands allow you
to access and update data in HP ALLBASE/SQL tables.

          SQL Commands 

------------------------------------------------------------------------------------------
|                                                                                        |
|                                                                                        |
|                                                                                        |
|  SELECT{ :table_name }FROM clauses[ other clauses]                                     |
|        { :select_list}                                                                 |
|                                                                                        |
|  [ FOR UPDATE OF column_name[ ,column_name...]];                                       |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
|                                                                                        |
|                                                                                        |
|  UPDATE table_name SET column_name = value[ ,...]   WHERE{ CURRENT OF cursor_name}     |
|                                                          { search_condition      }     |
------------------------------------------------------------------------------------------
|                                                                                        |
|                                                                                        |
|                                                                                        |
|  INSERT INTO table_name [ (column_name ...)] VALUES (SingleRowValues)                  |
|  This command is equivalent to the FILE *INSERT command in a logic block.              |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
|                                                                                        |
|                                                                                        |
|  DELETE FROM table_name WHERE CURRENT OF cursor_name                                   |
|  This command is equivalent to the FILE *DELETE command in a logic block.              |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
|                                                                                        |
|                                                                                        |
|  DELETE FROM table_name [ WHERE search_condition]                                      |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
|                                                                                        |
|                                                                                        |
|  SQLEXPLAIN                                                                            |
|  This command retrieves the text of SQL error messages into the communication area     |
|  field *ERROR. You cannot use a host variable reference with the SQLEXPLAIN command.   |
|                                                                                        |
------------------------------------------------------------------------------------------

SQL Command Limitations 

You cannot use the following commands in an HP ALLBASE/4GL SQL logic
block:

   *   BEGIN DECLARE SECTION and END DECLARE SECTION

   *   BULK

   *   CLOSE cursorname 

   *   CONNECT TO DBEnvironmentname 

   *   DECLARE cursorname 

   *   DESCRIBE commandname INTO areaname 

   *   EXECUTE IMMEDIATE

   *   FETCH

   *   INCLUDE SQLCA or SQLDA

   *   INTO (clause with SELECT command)

   *   OPEN cursorname 

   *   RELEASE

   *   START DBE and STOP DBE

   *   WHENEVER

If an SQL logic block contains a SELECT command, this must be the only
command in the SQL logic block.



MPE/iX 5.0 Documentation