Using Structures and Arrays to Insert - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

Product
Preprocessor2 for Embedded SQL
Release Number
15.00
Language
English (United States)
Last Update
2018-09-27
dita:id
B035-2446
lifecycle
previous
Product Category
Teradata Tools and Utilities

Using Structures and Arrays to Insert

To declare one structure to hold all the variables, use the following syntax:

EXEC SQL INSERT INTO <table name> VALUES (…) RETURNING :hoststructure1

For the array insert feature using a cursor, use the following syntax:

EXEC SQL
	DECLARE CURSORNAME CURSOR FOR
	INSERT INTO TABLENAME VALUES (:col1,:col2);
EXEC SQL FOR N
	OPEN CURSORNAME;