Performing SQL Statements Dynamically - 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ā„¢

You can execute SQL statements dynamically in either prepared or immediate form, as described in the following table.

Stored procedures only support the immediate form of dynamic SQL.
Dynamic SQL Statement Type Description
Prepared Valid statement text is prepared and preserved for the duration of the session and the statement can be executed as many times as the application requires.

There is some overhead in preparing an SQL statement, somewhat similar to the overhead required to compile and preprocess static SQL for an embedded SQL application.

Immediate Valid statement text is executed one time only.

If a statement must be executed more than one time in an application, then you must incur the overhead of preparing and performing it each time.

Related Information