Preparing an SQL Statement - Teradata Vantage - Analytics Database

SQL Stored Procedures and Embedded SQL

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
frc1628111662093.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
rjx1472253414573
lifecycle
latest
Product Category
Teradata Vantageā„¢
Using the syntax elements defined here, the process is as follows:
  1. Declare the variable statement_string in the client application language.
  2. Define statement_string as the literal character text of the SQL statement to be executed, still in the client application language.
  3. Execute the PREPARE statement from within SQL, defining the host variable statement_string as the SQL variable statement_name.

    PREPARE compiles the source code from statement_name into executable object code.

  4. Execute the EXECUTE or EXECUTE IMMEDIATE statement for statement_name.
  5. The database software posts return codes to SQLCODE and SQLSTATE.