Continuing SQL Requests and BTEQ | Basic Teradata Query - Continuing SQL - Basic Teradata Query

Basic Teradata® Query Reference - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Basic Teradata Query
Release Number
20.00
Published
October 2023
ft:locale
en-US
ft:lastEdition
2025-04-02
dita:mapPath
gxl1691484661681.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
psp1479308573013
Product Category
Teradata Tools and Utilities

An SQL request is automatically continued from one line to the next unless the line ends in a semicolon.

However, the following conditions are excluded:

Exceptions for Using Terminating Characters within SQL Requests Example Example
Semicolon embedded within a comment.
exec /* exec macro current; 
*/macro xyz;
Semicolon embedded in an unsatisfied left parenthesis, single-quote or double-quote pair.
create macro xyz as 
(select * from dbc.tables;  
);

create macro xyz as 
(select ‘abcd; 
efgh’;  
);

When an SQL request is continued from one line to the next, BTEQ translates the line-feed characters at the end of the multi-line SQL requests to carriage-return characters. However, in case of a line-feed appearing inside a quoted string in the request, the line-feed characters are retained as is.