16.10 - Delimiters - Teradata Database

Teradata Database SQL Fundamentals

Product
Teradata Database
Release Number
16.10
Release Date
June 2017
Content Type
Programming Reference
Publication ID
B035-1141-161K
Language
English (United States)

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 multi-statement 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.