Delimiters | SQL Fundamentals | Teradata Vantage - Delimiters - Advanced SQL Engine - Teradata Database

SQL Fundamentals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
zwv1557098532464.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1141
lifecycle
previous
Product Category
Teradata Vantage™

Delimiters are special characters having meanings that depend on context.

The function of each delimiter appears in the following table.

Delimiter Name Purpose
(

)

LEFT PARENTHESIS

RIGHT PARENTHESIS

Group expressions and define the limits of various phrases.
, COMMA Separates and distinguishes column names in the select list, or column names or parameters in an optional clause, or DateTime fields in a DateTime type.
: COLON Prefixes reference parameters or client system variables.

Also separates DateTime fields in a DateTime type.

. FULLSTOP
  • Separates database names from table, trigger, UDF, UDT, and stored procedure names, such as personnel.employee.
  • Separates table names from a particular column name, such as employee.deptno).
  • In numeric constants, the period is the decimal point.
  • Separates DateTime fields in a DateTime type.
  • Separates a method name from a UDT expression in a method invocation.
; SEMICOLON
  • Separates statements in multistatement requests.
  • Separates statements in a stored procedure body.
  • Separates SQL procedure statements in a triggered SQL statement in a trigger definition.
  • Terminates requests submitted via utilities such as BTEQ.
  • Terminates embedded SQL statements in C or PL/I applications.
APOSTROPHE
  • Defines the boundaries of character string constants.
  • To include an APOSTROPHE character or show possession in a title, double the APOSTROPHE characters.
  • Also separates DateTime fields in a DateTime type.
QUOTATION MARKS Defines the boundaries of nonstandard names.
/ SOLIDUS Separates DateTime fields in a DateTime type.
B

b

Uppercase B

Lowercase b

- HYPHEN-MINUS

Example: Using Delimiters

In the following statement submitted through BTEQ, the FULLSTOP separates the database name (Examp and Personnel) from the table name (Profiles and Employee), and, where reference is qualified to avoid ambiguity, it separates the table name (Profiles, Employee) from the column name (DeptNo).

UPDATE Examp.Profiles SET FinGrad = 'A'
WHERE Name = 'Phan A' ; SELECT EdLev, FinGrad,JobTitle,
YrsExp FROM Examp.Profiles, Personnel.Employee
WHERE Profiles.DeptNo = Employee.DeptNo ;

The first SEMICOLON separates the UPDATE statement from the SELECT statement. The second SEMICOLON terminates the entire multistatement request.

The semicolon is required in Teradata SQL to separate multiple statements in a request and to terminate a request submitted through BTEQ.