Adding Comments Teradata

Sometimes it is necessary or desirable to document the logic used in an SQL statement within the query. A comment is not executed and is ignored by the PE at syntax checking and resolution time.

ANSI Comment

To comment a line using the ANSI standard form of a comment:

  • the double dash at the start of a single line denotes a comment is on that line.
  • Each line that is a comment must be started with the same two dashes for each comment line. This is the only technique available for commenting using ANSI compliancy.

    At the writing of this book, Queryman sometimes gets confused and regards all lines after the - - as part of the comment. So, be careful regarding various client tools.

  • This is an ANSI form of comment that consists of a single line of user explanation or
  • add notes to an SQL command. This is a second line and needs additional dashes

Teradata Comment

To comment a line using the Teradata form of a comment:

  • /* the slash asterisk at the start of a line denotes the beginning of a comment
  • */ the asterisk slash (reversed from the start of a comment) is used to end a comment.
  • Both the start and the end of a comment can be a single line or multiple lines. This is the most common form of comment seen in Teradata SQL, primarily since it was the original technique available.

  • /* This is the Teradata form of comment that consists of a single line of user explanation or add notes to an SQL command. Several lines of comment can be added within a single notation. This is the end of the comment. */


Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Teradata Topics