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 default engine for the duration of a command.

Using Connections

CLOSE CONNECTION
Closes a named connection.

CLOSE_ALL_CONNECTIONS
Closes all connections on the named or 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 default connection for the duration of a command.

Using Cursors

CLOSE CURSOR
Closes a cursor.

CONTINUE
Fetches the next screenful of 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 statement.

Executing SQL Statements

QUERY
Specifies a SQL statement that returns data to be passed to the database engine for processing.

RUN
Specifies a SQL statement that will not return data to be passed to the database engine for processing.

SQL
Specifies a SQL statement to be passed to the database engine for processing.

Changing SELECT Behavior

ALIAS
Names a Panther variable as the destination of a selected column or an aggregate function.

BINARY
Creates a Panther variable 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
Sets the number of rows for Panther to fetch to an array and choose 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 a 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 a DBMS statement.