Oracle SQL, PLSQL, APEX How To's by Dr. S. Raghunathan - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

 

 

- - - - -

 

5

 

11.22  How to use REPLACE(  ) function

 

We want to replace all the commas in data as dash replace( column-nameldata to be replaced characters set,  replace with characters )

replace( ',aaa,bbb, ,   ','   '-' )

 

Syntax select instr( ',aaa,bbb, '   ,   ','   ,   '-') as result from dual;

Result :

 

Result

 

- - - - -

 

-aaa-bbb-