Chapter 11 . DBMS Statements and Commands

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

Each reference page contains the following information:

The commands can be executed with the JPL command DBMS (dbms) or 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 (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 (dbms) commands by category. Some commands might appear in more than one category.

Selecting a Database Engine

DBMS ENGINE
Sets the default database engine for the application.

DBMS WITH ENGINE
Sets the default engine for the duration of a command.

Using Connections

DBMS CLOSE CONNECTION
Closes a named connection.

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

DBMS CONNECTION
Sets a default connection and engine for the application.

DBMS DECLARE CONNECTION
Declares a named connection to a database engine.

DBMS WITH CONNECTION
Sets the default connection for the duration of a command.

Using Cursors

DBMS CLOSE CURSOR
Closes a cursor.

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

DBMS DECLARE CURSOR
Declares a named cursor.

DBMS EXECUTE
Executes a named cursor.

DBMS WITH CURSOR
Specifies the cursor to use for a statement.

Executing SQL Statements

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

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

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

Changing SELECT Behavior

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

DBMS BINARY
Creates a Prolifics variable for fetching binary values.

DBMS CATQUERY
Redirects SELECT results to a file or a Prolifics variable.

DBMS COLUMN_NAMES
Maps a database column name to a Prolifics variable.

DBMS FORMAT
Formats the results of a CATQUERY.

DBMS OCCUR
Sets the number of rows for Prolifics to fetch to an array and choose an occurrence where Prolifics should begin writing result rows.

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

DBMS UNIQUE
Suppresses repeating values in a selected column.

Paging through Multiple Rows

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

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

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

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

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

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

Handling Binary Data

DBMS BINARY
Defines one or more binary variables.

Status and Error Processing

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

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

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