SQL Strings - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

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

Apply these rules when using SQL strings in COBOL:

  • Define the variable used as a SQL string as a varying character type.
  • See “Host Variable Declaration” on page 163 for information on declaring VARCHAR fields.

  • Meet these requirements for the host variable:
  • These statements require level 49 fields to have valid COBOL field names other than FILLER:
  • CHECKPOINT
  • DATABASE
  • SET CHARSET
  • For LPI COBOL, if a varying character host variable is not declared at level 01, name the first level 49 field other than FILLER for use with any SQL statement.
  • These statements allow level 49 fields to have either a valid COBOL field name or the keyword FILLER, except in the LPI COBOL case as stated above:
  • EXECUTE IMMEDIATE
  • LOGON
  • PREPARE