Introduction

Static SQL refers to a particular type of application where SQL statements are fixed or static. This is as opposed to dynamic SQL where the actual statement to be executed against a database is created at run time. Thus static SQL statements are embedded SQL statements that do not vary during the execution of the application program.

Strictly speaking, embedded statements like the PREPARE statement are also static. They are embedded in an application program but they enable the use of dynamic SQL statements. Such statements are described in the section Dynamic SQL later in this documentation.

The following types of statements can be used:

  • DDL Statements
    Data Definition Language statements define database structures. An example of a DDL statement is the CREATE TABLE statement.

  • DML Statements
    Data Manipulation Language statements perform operations on the data in the database. An example of a DML statement is the SELECT statement.

  • DCL Statements
    Data Control Language statements control access to data. An example of a DCL statement is the GRANT statement.