Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
PREPARE
Prev Up35.14. Embedded SQL CommandsHome Next

PREPARE

PREPARE — prepare a statement for execution

Synopsis

PREPAREname FROMstring

Description

PREPARE prepares a statement dynamically specified as a string for execution. This is different from the direct SQL statementPREPARE, which can also be used in embedded programs. TheEXECUTE command is used to execute either kind of prepared statement.

Parameters

prepared_name

An identifier for the prepared query.

string

A literal C string or a host variable containing a preparable statement, one of the SELECT, INSERT, UPDATE, or DELETE.

Examples

char *stmt = "SELECT * FROM test1 WHERE a = ? AND b = ?";EXEC SQL ALLOCATE DESCRIPTOR outdesc;EXEC SQL PREPARE foo FROM :stmt;EXEC SQL EXECUTE foo USING SQL DESCRIPTOR indesc INTO SQL DESCRIPTOR outdesc;

Compatibility

PREPARE is specified in the SQL standard.

See Also

EXECUTE

Prev Up Next
OPEN Home SET AUTOCOMMIT
epubpdf
Go to PostgreSQL 10
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp