EXECUTE#
Примечание
Ниже приведена оригинальная документация Trino. Скоро мы ее переведем на русский язык и дополним полезными примерами.
Синтаксис#
EXECUTE statement_name [ USING parameter1 [ , parameter2, ... ] ]
Описание#
Executes a prepared statement with the name statement_name
. Parameter values
are defined in the USING
clause.
Примеры#
Prepare and execute a query with no parameters:
PREPARE my_select1 FROM
SELECT name FROM nation;
EXECUTE my_select1;
Prepare and execute a query with two parameters:
PREPARE my_select2 FROM
SELECT name FROM nation WHERE regionkey = ? and nationkey < ?;
EXECUTE my_select2 USING 1, 3;
This is equivalent to:
SELECT name FROM nation WHERE regionkey = 1 AND nationkey < 3;