Programming Guide



QUERY

Executes an SQL statement that returns one or more select sets

Synopsis

DBMS [WITH CONNECTION connection] QUERY SQLstatement

Arguments

WITH CONNECTION connection
Name of connection to associate with the statement. If the clause is not used, Panther uses the default connection.

SQLstatement
SQL statement to be sent to the database engine. The syntax of the statement can be the specific to the database engine.

Description

DBMS QUERY prepares SQLstatement (in general, one that returns rows) by indicating to the database engine where to put return data (if any), and then tells the database to execute the SQL statement.

This command is used for statements, such as SELECT statements and stored procedures, that return select data. For statements that do not return data, use RUN.

For additional information, refer to Chapter 29, "Reading Information from the Database," in Application Development Guide.

Example

DBMS QUERY SELECT title_id, name, dir_first_name, \
dir_last_name FROM titles

See Also

RUN