Oracle Special Characters

I have a request

select * from table where name in ('52 T&M', '60 T&M');

"&" causes the request to wait for the parameter. How can I qualify "&"? in a bite request so that the query can find the string using the "&" character in them?

+3
source share
3 answers

I would usually use set define offas suggested by omg, but you can also do it like this:

select *
from table
where name in ('52 T'||Chr(38)||'M', '60 T'||Chr(38)||'M');
+4
source

Ampersand ("&") is the character interpreted by SQLPlus as a placeholder variable. Using:

SET DEFINE OFF
+9
source

, sqlplus,

0
source

Source: https://habr.com/ru/post/1763841/


All Articles