Programming Guide


Chapter 11. DBMS Statements and Commands

This chapter describes the DBMS (dbms) commands, in alphabetical order, that are supported by all database engines.

Each reference page contains the following information:

The commands can be executed with the JPL command DBMS and with the C library function dm_dbms. Some database engines support additional commands; for DBMS commands that are specific to a database engine, refer to "Database Drivers." This includes the transaction commands and any special feature commands.

Since DBMS is a JPL command, using these commands inside a JPL statement must follow all the conventions for JPL.


DBMS Command Summary

The following listing is a summary of the DBMS commands by category. Some commands might appear in more than one category.

Selecting a Database Engine

ENGINE
Sets the default database engine for the application.

WITH ENGINE
Sets the engine to use for a command.

Using Connections

CLOSE CONNECTION
Closes a named connection.

CLOSE_ALL_CONNECTIONS
Closes all connections on the named or on the default engine.

CONNECTION
Sets a default connection and engine for the application.

DECLARE CONNECTION
Declares a named connection to a database engine.

WITH CONNECTION
Sets the connection to use for a command.

Using Cursors

CLOSE CURSOR
Closes a cursor.

CONTINUE
Fetches the next rows from a select set.

DECLARE CURSOR
Declares a named cursor.

EXECUTE
Executes a named cursor.

WITH CURSOR
Specifies the cursor to use for a command.

Executing SQL Statements

QUERY
Specifies an SQL statement that returns one or more select sets to be passed to the database engine for processing.

RUN
Specifies an SQL statement that will not return any select sets to be passed to the database engine for processing.

SQL
Specifies an SQL statement to be passed to the database engine for processing (not recommended).

Changing SELECT Behavior

ALIAS
Defines Panther variables as the destination of selected columns and/or aggregate functions in a select set.

BINARY
Defines Panther variables for fetching binary values.

CATQUERY
Redirects SELECT results to a file or a Panther variable.

COLUMN_NAMES
Maps a database column name to a Panther variable.

FORMAT
Formats the results of a CATQUERY.

OCCUR
Optionally sets the number of rows for Panther to fetch to an array and chooses an occurrence where Panther should begin writing result rows.

START
Sets the first row for Panther to return from a select set.

UNIQUE
Suppresses repeating values in a selected column.

Paging through Multiple Rows

CONTINUE
Fetches the next screenful of rows from a select set.

CONTINUE_BOTTOM
Fetches the last screenful of rows from a select set.

CONTINUE_DOWN
Fetches the next screenful of rows from a select set.

CONTINUE_TOP
Fetches the first screenful of rows from a select set.

CONTINUE_UP
Fetches the previous screenful of rows from a select set.

STORE
Stores the rows of a select set in a temporary file so that the application can scroll through the rows.

Handling Binary Data

BINARY
Defines one or more binary variables.

Status and Error Processing

ONENTRY
Installs a function or JPL procedure which Panther calls before executing each DBMS statement.

ONERROR
Installs a function or JPL procedure which Panther calls whenever a DBMS statement fails.

ONEXIT
Installs a function or JPL procedure which Panther calls after executing each DBMS statement.