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](https://wikitechy.com/tutorials/oracle/img\oracle-images\character-function-oracle.png)
- 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](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-select-output.png)
- In this table “wikitechy_char” , the text ‘LAKSHMI’ is in upper case.
![oracle character function lower condition](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-lower-condition.png)
- LOWER(‘LAKSHMI’) function is being used to show the name in lower case from the table “wikitechy_char”.
- Clicking on the Run button the query is executed.
- 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](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-select-upper-output.png)
- In this table “wikitechy_char” , the text ‘venkat’ is in lower case.
![oracle character function upper condition](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-upper-condition.png)
- UPPER (‘venkat’) function is being used to show the name in upper case from the table “wikitechy_char”.
- Clicking on the Run button the query is executed.
- 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](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-select-initcap-output.png)
- In this table “wikitechy_char” , the text ‘venkat’ is in lower case.
![oracle character function initcap condition](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-initcap-condition.png)
- INITCAP (‘venkat’) function is being used to show the name of the first letter is in upper case from the table “wikitechy_char”.
- Clicking on the Run button the query is executed.
- 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](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-select-length-output.png)
- In this table “wikitechy_char” , the text ‘Vinoth Kumar’ is shown.
![oracle character function lenght condition](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-lenght-condition.png)
- LENGTH (‘Vinoth Kumar’) function is being used to show the length of the given words from the table “wikitechy_char”.
- Clicking on the Run button the query is executed.
- 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](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-substr-condition.png)
- SUBSTR (‘Vinoth Kumar’) function is being used to show the length of the given words from the table “wikitechy_char”.
- Clicking on the Run button the query is executed.
- 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](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-instr-condition.png)
- INSTR (‘Vinoth Kumar’) function is being used to show the length of the given words from the table “wikitechy_char”.
- Clicking on the Run button the query is executed.
- 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](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-replace-condition.png)
- REPLACE (‘Arun’,‘Vinoth’) function is being used to show the length of the given words from the table “wikitechy_char”.
- Clicking on the Run button the query is executed.
- 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](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-cancat-output.png)
![oracle character function concat condition](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-character-function-concat-condition.png)
- SUBSTR (‘Vinoth Kumar’) function is being used to show the length of the given words from the table “wikitechy_char”.
- Clicking on the Run button the query is executed.
- We can see the row which has been successfully Show the length of the word.