String functions
LOWER:- It converts all capital letters to small letters
Syn:- LOWER(char exp)
Ex:- select lower(‘PRASAD’) from dual;
Select lower(na) from vision;
INITCAP:- It conver the first character of the sentence to capital letter.
Syn:- INITCAP(char exp)
Ex:- select initcap(‘welcome to vision’) from dual;
Select initcap(na) from vision;
UPPER:- It converts all small letters to capital letters.
Syn:- UPPER(char exp)
Ex:- select upper(‘vision’) from dual;
Select upper(na) from vision;
TRANSLATE:- It is used to replace the given character in the string
Syn:- TRANSLATE(‘string’,char1,char2);
Ex:- select translate(‘vision computers’,’i’,’s’) from dual;
SUBSTR:- It returns the string from N1 to N2 Characters.
Syn:- SUBSTR(char exp,n1,n2);
Ex:- select substr(‘prasad’,2,3) from dual;
REPLACE:- It is used to replace the string in the give sentence.
Syn:- REPLACE(‘string’,’search char1’,’replace string’)
Ex:- select replace(‘vision computers’,’i’,’kk’) from dual;
CHR:- It returns the ascii char for the given code.
Syn:- CHR(code)
Ex:- select chr(65) from dual;
LENGTH:- It is used to find the length of the given string.
Syn:- LENGTH(string);
Ex:- select length(‘prasad’) from dual;
LTRIM:- It is used to removes characters from leftside for given expression.
Syn:- LTRIM(string,char);
Ex:- select ltrim(‘vision’,’v’) from dual;
RTRIM:- It is used to removes characters from rightside for given expression.
Syn:- RTRIM(string,char);
Ex:- select rtrim(‘vision’,’n’) from dual;
LPAD:- It returns char1 left padded to length n with the sequence of characters
Syn:- LPAD(‘char1’,n,’char2’)
Ex:- select lpad(‘prasad’,10,’*’) from dual;
RPAD:- It returns char1 right padded to length n with the sequence of characters
Syn:- RPAD(‘char1’,n,’char2’)
Ex:- select rpad(‘prasad’,10,’*’) from dual;
Soundex :- Returns a phonetic representation of characters. This compares two words that are spelled differently but sound alike in English.
Syntax:- Soundex(char)=soundex(char);
Ex:- select ename from emp where soundex(ename)=soundex(‘SMYTH’);
NVL: If expression1 is null returns Expression 2 .
Syn:- NVL(exp1,exp2);
Ex:- select ename,nvl(to_char(comm),’NotApplicable’) from emp;
For
Online Classes
Contact Us: +919885348743
Online Classes
Contact Us: +919885348743