Overview

EXECUTE statement_name [ USING parameter1 [ , parameter2, ... ] ]

Description

Executes a precompiled query statement. Arguments are defined in the USING clause.

Examples

  • Example 1:
    PREPARE my_select1 FROM
    SELECT name FROM nation;
    --- Execute a precompiled query statement
    EXECUTE my_select1;
    Example 2
  • Example 2:
    PREPARE my_select2 FROM
    SELECT name FROM nation WHERE regionkey = ? and nationkey < ? ;
    --- Execute a precompiled query statement
    EXECUTE my_select2 USING 1, 3; 
    --- The preceding statement is equivalent to this statement:
    SELECT name FROM nation WHERE regionkey = 1 AND nationkey < 3;