Thursday 30 May 2013

Character Functions in SQL

  • Case-manipulation functions
    • LOWER   :- Converts alpha character values to lowercase.
    • UPPER   :-  Converts alpha character values to uppercase.
    • INITCAP  :-  Converts alpha character values to uppercase for the first letter of               each word.
  • Character-manipulation functions
    • CONCAT  :-  Concatenates the first character values to second character value.
    • SUBSTR  :-  Return specified characters from character value.
    • LENGTH  :-  Returns the number of character in the expression.
    • INSTR  :-  Returns the numeric position of a named string.
    • LPAD  :-  Pads the character value right justified to a total width of n.
    • RPAD  :- Pads the character value left justified to a total width of n.
    • TRIM  :-  Enables you to trim heading or trailing characters from a character string.
    • REPLACE  :-  Searches a text expression for a character string and if found, replaces it with a specified replacement string.
Example:

LOWER
UPPER & INITCAP


CONCAT

SUBSTR


LENGTH


INSTR


LPAD & RPAD


TRIM




No comments:

Post a Comment