Performing SQL Statements Dynamically - Advanced SQL Engine - Teradata Database

SQL Stored Procedures and Embedded SQL

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
xqq1557098602407.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1148
lifecycle
previous
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 Topics

For more information about: