pg_exec_prepared

Name

pg_exec_prepared -- send a request to execute a prepared SQL statement to the server

Synopsis

pg_exec_prepared conn statementName ?args?

Description

pg_exec_prepared submits a command to the PostgreSQL server and returns a result.

pg_exec_prepared functions identically to pg_exec, except that it operates using statements prepared by the PREPARE SQL command.

Note that prepared statements are only support under PostgreSQL 7.4 and later.

Arguments

conn

The handle of the connection on which to execute the command.

statementName

The name of the prepared statement to execute.

args

args consists of zero or more optional values that can be inserted, unquoted, into the SQL statement using $-style substitution.

Return Value

A result handle. See pg_exec for details.

Example

pg_exec $conn {prepare insert_people 
    (varchar, varchar, varchar, varchar, varchar, varchar) 
    as insert into people values ($1, $2, $3, $4, $5, $6);}

pg_exec_prepared $conn insert_people $email $name $address $city $state $zip