Using Dynamic SQL - Advanced SQL Engine - Teradata Database

SQL Stored Procedures and Embedded SQL

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
vqj1592443206677.ditamap
dita:ditavalPath
vqj1592443206677.ditaval
dita:id
B035-1148
lifecycle
previous
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.