Char Oracle | Character Functions - oracle tutorial - sql tutorial



What is Oracle Character functions ?

  • Character functions operate on values of data type CHAR or VARCHAR.
 character function oracle
  • Oracle character functions are used to modify a char or varchar2 column.
  • You may need to modify a column before comparing it to another value, or you may need it in a different format than it is stored in the database.

LOWER:

  • Returns a given string in lower case.

Example:

SELECT  LOWER('LAKSHMI') FROM  wikitechy_char;
click below button to copy the code. By - oracle tutorial - team

Screenshot:

 oracle character function select output
  1. In this table “wikitechy_char” , the text ‘LAKSHMI’ is in upper case.
 oracle character function lower condition
  1. LOWER(‘LAKSHMI’) function is being used to show the name in lower case from the table “wikitechy_char”.
  2. Clicking on the Run button the query is executed.
  3. We can see the row which has been successfully modified the text LAKSHMI from upper case to lower case “lakshmi”.

UPPER:

  • Returns a given string in upper case.

Example:

SELECT UPPER ('venkat') FROM  wikitechy_char;
click below button to copy the code. By - oracle tutorial - team

Screenshot:

 oracle character function select upper output
  1. In this table “wikitechy_char” , the text ‘venkat’ is in lower case.
 oracle character function upper condition
  1. UPPER (‘venkat’) function is being used to show the name in upper case from the table “wikitechy_char”.
  2. Clicking on the Run button the query is executed.
  3. We can see the row which has been successfully modified the text venkat from lower case to upper case “VENKAT”.

INITCAP:

  • Returns a given string with Initial letter in capital.

Example:

SELECT INITCAP ('venkat') FROM  wikitechy_char;
click below button to copy the code. By - oracle tutorial - team

Screenshot:

 oracle character function select initcap output
  1. In this table “wikitechy_char” , the text ‘venkat’ is in lower case.
 oracle character function initcap condition
  1. INITCAP (‘venkat’) function is being used to show the name of the first letter is in upper case from the table “wikitechy_char”.
  2. Clicking on the Run button the query is executed.
  3. We can see the row which has been successfully modified the text venkat into “Venkat”.
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql

LENGTH:

  • Returns the length of a given string.

Example:

SELECT LENGTH ('Vinoth Kumar') FROM  wikitechy_char;  
click below button to copy the code. By - oracle tutorial - team

Screenshot:

 oracle character function select length output
  1. In this table “wikitechy_char” , the text ‘Vinoth Kumar’ is shown.
 oracle character function lenght condition
  1. LENGTH (‘Vinoth Kumar’) function is being used to show the length of the given words from the table “wikitechy_char”.
  2. Clicking on the Run button the query is executed.
  3. We can see the row which has been successfully Show the length of the word.

SUBSTR:

  • Returns a substring from a given string. Starting from position p to n characters.

Example:

SELECT SUBSTR ('Vinoth Kumar',7,6) FROM  wikitechy_char;
click below button to copy the code. By - oracle tutorial - team

Screenshot:

 oracle character function substr condition
  1. SUBSTR (‘Vinoth Kumar’) function is being used to show the length of the given words from the table “wikitechy_char”.
  2. Clicking on the Run button the query is executed.
  3. We can see the row which has been successfully Show the length of the word.
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql

INSTR:

  • Tests whether a given character occurs in the given string or not.
  • If the character occurs in the string then returns the first position of its occurrence otherwise returns 0.
SELECT INSTR('Vinoth Kumar','n') FROM  wikitechy_char;  
click below button to copy the code. By - oracle tutorial - team

Screenshot:

 oracle character function instr condition
  1. INSTR (‘Vinoth Kumar’) function is being used to show the length of the given words from the table “wikitechy_char”.
  2. Clicking on the Run button the query is executed.
  3. We can see the row which has been successfully Show the length of the word.

REPLACE:

  • Replaces a given set of characters in a string with another set of character.

Example:

SELECT REPLACE ('Arun','Vinoth') FROM  wikitechy_char;
click below button to copy the code. By - oracle tutorial - team

Screenshot:

 oracle character function replace condition
  1. REPLACE (‘Arun’,‘Vinoth’) function is being used to show the length of the given words from the table “wikitechy_char”.
  2. Clicking on the Run button the query is executed.
  3. We can see the row which has been successfully Show the length of the word.
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql

CONCAT:

  • Combines a given string with another string.

Example:

SELECT CONCAT (CONCAT(Name, ‘is a'),Designation) FROM  wikitechy_char;
click below button to copy the code. By - oracle tutorial - team

Screenshot:

 oracle character function cancat output
 oracle character function concat condition
  1. SUBSTR (‘Vinoth Kumar’) function is being used to show the length of the given words from the table “wikitechy_char”.
  2. Clicking on the Run button the query is executed.
  3. We can see the row which has been successfully Show the length of the word.

This tutorial provides an indepth knowledge on the following items such as oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , mysql tutorial , sql tutorial for beginners , learn sql , oracle database tutorial , sql query tutorial , oracle dba tutorial , plsql tutorial , oracle tutorial pdf , oracle pl sql tutorial , oracle sql tutorial , sql tutorial point , oracle tutorial for beginners , learn oracle online free , learn oracle online , learning pl sql programming , learn sql online for free , sql learning online , dba oracle tutorial , oracle sql tutorial advanced , oracle 11g dba tutorial with examples , oracle online learning , oracle learning online , how to learn pl sql , sql coding tutorial , sql learning websites , sql basic learning

Related Searches to Char Oracle | Character Functions