1.

Explain different string manipulation operators and functions associated with Teradata.

Answer»

The Teradata String functions are used to manipulate STRINGS and are also compatible with the ANSI STANDARD. Additionally, it supports some standard string functions as WELL as the Teradata extensions to those functions.

  • SUBSTRING: It EXTRACTS a selective portion of the long string (ANSI standard).

Example:  Consider a string “InterviewBit” from a table.

SELECT SUBSTRING('Interviewbit' FROM 1 FOR 5);

Output: 

Inter
  • POSITION: An individual character in a string (ANSI standard) can be located.

Example:

SELECT POSITION("r" IN "InterviewBit");

Output:

5
  • TRIM: Removes (trims) blank space from a specified string.

Example: 

SELECT TRIM(" InterviewBit ");

Output:

InterviewBit
  • UPPER: The string is converted to uppercase.

Example:

SELECT UPPER("InterviewBit");

Output:

INTERVIEWBIT
  • LOWER: The string is converted to lowercase.

Example:

SELECT LOWER("INTERVIEWBIT");

Output:

interviewbit


Discussion

No Comment Found