Executing the SQL Statement CALL

Restriction: This topic applies to Windows environments only.

Use the CALL statement to execute each series of SQL statements in your application. For example, to call the stored procedure described in How an Application Works With a Stored Procedure, your application might use this statement:

EXEC SQL
  CALL STPROC1
    (:V1, :V2)
END-EXEC

If you use host variables in the CALL statement, you must declare them before using them.

Each of the above CALL statement examples uses an SQLDA. If you do not explicitly provide an SQLDA, the precompiler generates the SQLDA based on the variables in the parameter list.

You can execute the CALL statement only from an application program. You cannot use the CALL statement dynamically.