Preprocessor2 treats SQL character strings as host variables that are neither input nor output.
An SQL string is a series of characters used to complete an embedded SQL statement. An SQL string does not correspond to a field in a row of a table, and therefore is not an input or an output variable.
Character Strings as Host Variables
SQL character strings are a distinct category of host variable because some host languages apply special rules to them. Those rules are detailed in the language-dependent sections of Teradata® Preprocessor2 for Embedded SQL Programmer Guide, B035-2446.
Character strings can require a leading COLON character when referenced in an embedded SQL statement. For details, see the following topics and the information about their statements in this section.
Statements That Use Strings as Host Variables
The following table lists embedded SQL statements that use SQL strings as host variables.
| SQL Statement | When Statement Uses SQL String as Host Variable |
|---|---|
| CHECKPOINT | When the checkpoint label is expressed as a host variable. |
| DATABASE | When the database name is expressed as a host variable. |
| EXECUTE IMMEDIATE | When the SQL statement string is expressed as a host variable. |
| LOGON | For the logon string. |
| PREPARE | When the SQL statement string is expressed as a host variable. |
| SET CHARSET | When the character set name is expressed as a host variable. |