0% found this document useful (0 votes)
26 views

Character Functions

The document provides examples of SQL functions such as SUBSTR, INSTR, RPAD, LPAD, LTRIM, RTRIM, TRIM, REPLACE, TRANSLATE, and SOUNDEX that can be used to manipulate and analyze string values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Character Functions

The document provides examples of SQL functions such as SUBSTR, INSTR, RPAD, LPAD, LTRIM, RTRIM, TRIM, REPLACE, TRANSLATE, and SOUNDEX that can be used to manipulate and analyze string values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

+044 (234234)

Syntax: substr(string [,m,n])

SELECT substr('ORACLE DATA RECOVERY',8,4) FROM DUAL;


SELECT substr('ORACLE DATA PUMP',8) FROM DUAL;
SELECT substr('ORACLE BACKUP',-6) FROM DUAL;
SELECT length('Oracle Data Guard') FROM DUAL;

Syntax: instr('Main String', 'substring', [m], [n])


SELECT instr('oralce apps is a great application','app') FROM DUAL;
SELECT instr('oralce apps is a great application','app',1,3) FROM DUAL;

Syntax: rpad(column, n, 'string');


SELECT rpad('100',5,'x') FROM DUAL;
SELECT lpad('100',5,'x') FROM DUAL;

SELECT ltrim(' Hello ') || ' All' from dual;


SELECT rtrim(' Hello ') || ' All' from dual;
SELECT trim(' Hello ') || ' All' from dual;

SELECT ltrim('*****Remainder*******','*') || ' to All' from dual;

SELECT trim('*' from '*****Remainder*******') || ' to All' from dual;


Syntax: trim(leading|trailing|both, trim_char from trim_source)
SELECT trim('O' FROM 'ORACLE') FROM DUAL;

Syntax: replace(column, old_char,new_char)


SELECT replace('ORACLE DATA BACKUP', 'DATA','DATABASE') FROM DUAL
SELECT TRANSLATE('ORACLE DATA BACKUP RECOVERY', 'AO', '*#') AS "New Text" FROM
DUAL;

SELECT ENAME
FROM scott.emp
WHERE SOUNDEX(ename) = SOUNDEX('SMYTHE') ORDER BY ename

color
colour
kolor

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy