PREPARE

PREPARE is not available through the REST API, which keeps no session between requests. Run it through a database driver. With the REST API, pass parameter values in the request's bindings field or use EXECUTE IMMEDIATE. See REST API and drivers.

Synopsis

PREPARE statement_name FROM statement

Description

Prepares a statement for execution at a later time. Prepared statements are queries that are saved in a session with a given name. The statement can include parameters in place of literals to be replaced at execution time. Parameters are represented by question marks.

Examples

Prepare a select query:

PREPARE my_select1 FROM
SELECT * FROM nation;

Prepare a select query that includes parameters. The values to compare with regionkey and nationkey will be filled in with the EXECUTE statement:

PREPARE my_select2 FROM
SELECT name FROM nation WHERE regionkey = ? AND nationkey < ?;

See also

success-mail-img

You've joined our email list. Our newsletter will be delivered to your inbox every other week, with news from Peaka and the no-code world, as well as updates on the latest trends and developments in the data integration space!

success-mail-img

Thank you for your interest. We'll contact you soon.