Entering content frame

 Overview of Precompiler Statements 

You have the following options when you embed SQL statements in the source code of an application program:

·        Static SQL statements

·        Dynamic SQL statements

·        ARRAY statements

The embedded statements consist of statements to the precompiler, and the actual statement that is sent to the database.

The key words EXEC SQL form the simplest precompiler statement. The static SQL statement EXEC SQL <statement> specifies that the database kernel executes the database statement <statement>.

 

This table gives you an overview of the precompiler statements and how they are used:

CANCEL statement

Cancels a running SQL statement

CONNECT statement

Statement for connecting to the database instance

DECLARE statements

Indicate declare sections

DESCRIBE statement

Initializes a descriptor structure for a dynamic SQL statement

EXEC COMMAND statement

Executes an operating system command

EXECUTE statement

Executes a dynamic SQL statement

EXECUTE IMMEDIATE-statement

Calls a dynamic SQL statement without parameters

GETVAL statement

Reads LONG columns piecewise

INCLUDE DECLARE statement

Generates structure definitions

INCLUDE FILE statement

Inserts file content in the source text

OPEN CURSOR statement

Executes a dynamic SQL statement with named result table

PREPARE statement

Prepares a dynamic SQL statement

PUTVAL statement

Inserts values in LONG columns piecewise

SET SERVERDB statement

Statement for connecting to the database instance

TRACE statements

Activates logging in a trace file

USING clause

Assigns parameter values in a dynamic SQL statement

VERSION statement

Displays the software version

WHENEVER statements

Calls actions with conditions

See also: Syntax List, Working with Multiple Database Sessions, Compatibility with Other Database Systems

For the syntax of the database statements in the SQL mode INTERNAL, see the Reference Manual.

 

Leaving content frame