2
Thanks

A few words of thanks would be greatly appreciated.

Oracle - Making use of special characters




Intro


For some SQL queries, we need to search for strings containing special characters like '%'.
  • Considering the below example, the need is to find records containing the middle character '%':


Select *  
From table  
where fields like '%%%'; 

Solution

  • To do this you must know how to seperate the special characters.
  • First of all we must give a value to SQL ESCAPE parameter, for example '^':

SQL>SET ESCAPE ^
  • From there, the character '^' can be used to identify and seperate special characters.



Select *  
From table  
where fields like '%^%%';
2
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Oracle - Making use of special characters », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).

0 Comments