SQL syntax for prepared statements - Amazon Athena
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

SQL syntax for prepared statements

You can use the PREPARE, EXECUTE and DEALLOCATE PREPARE SQL statements to run parameterized queries in the Athena console query editor.

  • To specify parameters where you would normally use literal values, use question marks in the PREPARE statement.

  • To replace the parameters with values when you run the query, use the USING clause in the EXECUTE statement.

  • To remove a prepared statement from the prepared statements in a workgroup, use the DEALLOCATE PREPARE statement.

The following sections provide additional detail about each of these statements.