SQL Cursors | Teradata Vantage - SQL Cursors - 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ā„¢

This section describes SQL cursors, including what they are and when and how to use them to point to rows in an SQL response set.

A cursor is a data structure that stored procedures and Preprocessor2 use at runtime to point to the result rows in a response set returned by an SQL query.

Stored procedures and embedded SQL also use cursors to manage inserts, updates, execution of multistatement requests, and SQL macros.

The syntax of functionally similar cursor control statements sometimes varies depending on whether they are used for stored procedures or embedded SQL. This document presents variant syntax forms with the individual cursor control statements. Several cursor control statements are valid only with embedded SQL.

Cursors are not valid for sessions you conduct interactively from a terminal using a query manager like BTEQ.