Using Dynamic SQL - 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ā„¢

Dynamic SQL is useful for situations where you do not know the full text of some or all of the SQL statements your application will require at runtime.

For example, dynamic SQL would be useful for a spreadsheet-driven application where a user interactively types one or more formulas into the cells.

These formulas are then translated into SQL statements that retrieve the data needed to perform the calculations specified by each spreadsheet formula.

Because you cannot know in advance which SQL statements are required to support the ad hoc formulas the user may type, you should code the application using dynamic SQL features to support the dynamic requirements of the spreadsheet.