Previous Topic: Dynamic ParametersNext Topic: Special Registers


Expansion of Dynamic-parameter-marker

The expanded parameters of dynamic-parameter-marker indicate the use of a dynamic parameter.

Syntax

Expansion of dynamic-parameter-marker

►►── ? ───────────────────────────────────────────────────────────────────────►◄
Parameters
?

Indicates that a dynamic parameter is used to supply a value when the statement is executed.

Usage

Dynamic SQL Only

Dynamic parameter markers may appear only within the text of an SQL statement which is compiled dynamically using the PREPARE statement. They may not be used in statements compiled through an EXECUTE IMMEDIATE statement nor in statements embedded in a host application program.

Note: For more information about the use of dynamic parameters, see Dynamic Parameters.

Example

The following INSERT statement contains dynamic parameter markers to indicate that values for the associated dynamic parameters are supplied when the statement is executed. The EXECUTE statement that follows, supplies those values through the use of host variables.

insert into coverage (plan_code, emp_id, selection_date,
    num_dependents)
    values (?, ?, current date, ?)

execute dyninsert using
    :wk-plan, :wk-emp, :wk-deps indicator :wk-deps-i