EXECUTE <refpurpose>execute a prepared statement</refpurpose> — プリペアド文を実行する
EXECUTEname[ (parameter[, ...] ) ]
<command>EXECUTE</command> 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
<command>PREPARE</command> statement executed earlier in the
current session.
EXECUTEは、事前に作成されたプリペアド文を実行する際に使用します。
プリペアド文はセッション中にしか存在できないため、事前に同一セッション中のPREPARE文によって作成されたものでなければなりません。
If the <command>PREPARE</command> statement that created the statement
specified some parameters, a compatible set of parameters must be
passed to the <command>EXECUTE</command> 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.
文を作成したPREPARE文にパラメータが指定されている場合は、これに適合するパラメータの集合がEXECUTEに渡される必要があります。
そうしないと、エラーになります。
(関数とは異なり)プリペアド文は、パラメータのデータ型や個数によってオーバーロードされることはありません。
プリペアド文の名前は、1つのデータベースセッション内で一意でなければなりません。
For more information on the creation and usage of prepared statements, see <xref linkend="sql-prepare"/>. プリペアド文の作成方法と使用方法についての詳細はPREPAREを参照してください。
nameThe name of the prepared statement to execute. 実行するプリペアド文の名前を指定します。
parameterThe actual value of a parameter to the prepared statement. This must be an expression yielding a value that is compatible with the data type of this parameter, as was determined when the prepared statement was created. プリペアド文に対するパラメータの実際の値を指定します。 これは、プリペアド文が生成された時に決定される、そのパラメータのデータ型と互換性のある値を返す式である必要があります。
The command tag returned by <command>EXECUTE</command>
is that of the prepared statement, and not <literal>EXECUTE</literal>.
EXECUTEで返されるコマンドタグは、EXECUTEではなく、プリペアド文のコマンドタグとなります。
Examples are given in <xref linkend="sql-prepare-examples"/> in the <xref linkend="sql-prepare"/> documentation. 例はPREPAREの説明のExamplesにあります。
The SQL standard includes an <command>EXECUTE</command> statement,
but it is only for use in embedded SQL. This version of the
<command>EXECUTE</command> statement also uses a somewhat different
syntax.
標準SQLにはEXECUTE文が含まれていますが、これは埋め込みSQLでのみ使用できます。
また、このバージョンのEXECUTE文では、多少異なる構文が使用されています。