EXECUTE 中文man頁面
NAME
EXECUTE - 執(zhí)行一個準(zhǔn)備好的查詢
SYNOPSIS
EXECUTE plan_name [ (parameter [, ...] ) ]
DESCRIPTION 描述
EXECUTE 用于執(zhí)行一個前面準(zhǔn)備好的語句。 因為一個準(zhǔn)備好的查詢只在會話的生命期里存在,那么準(zhǔn)備好的查詢必須是在當(dāng)前會話的前些時候用 PREPARE 語句執(zhí)行的。
如果創(chuàng)建語句的 PREPARE 語句聲明了一些參數(shù), 那么傳遞給 EXECUTE 語句的必須是一個兼容的參數(shù)集, 否則就會生成一個錯誤。請注意(和函數(shù)不同),準(zhǔn)備好的語句不會基于參數(shù)的類型或者個數(shù)重載: 在一次數(shù)據(jù)庫會話過程中,準(zhǔn)備好的語句的名字必須是***的。
有關(guān)創(chuàng)建和使用準(zhǔn)備好的語句的更多信息, 請參閱 PREPARE [prepare(7)].
PARAMETERS 參數(shù)
- plan_name
要執(zhí)行的準(zhǔn)備好的語句。- parameter
給準(zhǔn)備好的語句的一個參數(shù)的具體數(shù)值。 它必須是一個生成與創(chuàng)建這個準(zhǔn)備好的語句的 PREPARE 語句指定參數(shù)位置的參數(shù)相兼容的數(shù)據(jù)類型的表達(dá)式。
COMPATIBILITY 兼容性
SQL 標(biāo)準(zhǔn)包括一個 EXECUTE 語句, 但它只是用于嵌入的 SQL 客戶端。PostgreSQL 實現(xiàn)的 EXECUTE 的語法也略微不同。
#p#
NAME
EXECUTE - execute a prepared statement
SYNOPSIS
EXECUTE plan_name [ (parameter [, ...] ) ]
DESCRIPTION
EXECUTE is used to execute a previously prepared statement. Since prepared statements only exist for the duration of a session, the prepared statement must have been created by a PREPARE statement executed earlier in the current session.
If the PREPARE statement that created the statement specified some parameters, a compatible set of parameters must be passed to the EXECUTE statement, or else an error is raised. Note that (unlike functions) prepared statements are not overloaded based on the type or number of their parameters; the name of a prepared statement must be unique within a database session.
For more information on the creation and usage of prepared statements, see PREPARE [prepare(7)].
PARAMETERS
- plan_name
- The name of the prepared statement to execute.
- parameter
- The actual value of a parameter to the prepared statement. This must be an expression yielding a value of a type compatible with the data type specified for this parameter position in the PREPARE command that created the prepared statement.
COMPATIBILITY
The SQL standard includes an EXECUTE statement, but it is only for use in embedded SQL. This version of the EXECUTE statement also uses a somewhat different syntax.


















