Status Inquiry Statements

 <     >         Status Inquiry Example       Status Inquiry Flow Charts       Table of Contents

 

Various statements are provided to return information about connections, queries, columns, parameters, and errors.  These statements return the information in a predefined COBOL group data item.  The definitions of these group data items for each statement are provided in the lisqldef.cpy copy file.  The data descriptions for the elementary items of these groups are contained in separate InstantSQL copy files to make it easy to define additional description groups.  (See the topic InstantSQL Components for more information on InstantSQL copy files.)

InstantSQL provides the following status inquiry statements:

 

Statement

Purpose

SQL DESCRIBE CONNECTION

Obtain information about a connected data source.

SQL DESCRIBE QUERY

Obtain information about a created query, including prepared and browse queries.

SQL DESCRIBE ERROR

Obtain information about errors that occurred in the prior InstantSQL statement execution.

SQL DESCRIBE COLUMN

Obtain information about a result set column for a created query, including prepared and browse queries.

SQL DESCRIBE PARAMETER

Obtain information about a parameter in a created query (browse queries do not have parameters).

The SQL DESCRIBE CONNECTION statement returns information about a connection, including information about the connected data source.  A brief form of the connection description can be obtained in the sql-Connection-Description group data item.  An extended form of the connection description can be obtained in the sql-Connection-Description-Ext group data item.

The SQL DESCRIBE QUERY statement returns information about a query.  The query description can be obtained in the sql-Query-Description group data item.

The SQL DESCRIBE COLUMN statement returns information about a column in a row of the result set of a query.  A brief form of the column description can be obtained in the sql-Column-Description group data item.  An extended form of the connection description can be obtained in the sql-Column-Description-Ext group data item.  This statement can be particularly useful when the contents or order of the result set are unknown.

The SQL DESCRIBE PARAMETER statement returns information about a parameter of a query.  The parameter description can be obtained in the sql-Param-Description group data item.  An application may also obtain a parameter description in the sql-Column-Description or sql-Column-Description-Ext group data items since a parameter description is a subset of a column description.

The SQL DESCRIBE ERROR statement returns information about an error returned by any InstantSQL statement, including details about any ODBC error that occurred or any ODBC informational messages that occurred.  The error description can be obtained in the sql-Error-Description group data item.  There is a configuration option (AllowErrorMessageOnly) to allow obtaining only the error message text into a data item that is a different size than an error-description-group data item.  (See the topic InstantSQL Configuration for more information on configuring InstantSQL.)

Status Inquiry Example

© Copyright 2000-2020 Micro Focus or one of its affiliates.