Using & in Oracle search

2

I have a question about the use of & in Oracle.

See below my table.

Whenreferringtothedescription'EasyBreezyEmailmkt&I',Oracleopensawindowforparameterpassing,asshownbelow.

My question, how can I query with & without the bank understanding this as a variable? and without using a set define off?

    
asked by anonymous 19.07.2017 / 20:38

2 answers

4

Normally to solve when I use PLSQL, I do this:

SELECT * 
  FROM MARK_CAMPANHA
-- WHERE DESCRICAO = 'Easy Breezy Emailmkt '||'&'||' Eu';

Searching a little bit now, I found using SET ESCAPE , using SQLDeveloper.

SET ESCAPE ON
SET ESCAPE "\"
SELECT * 
  FROM MARK_CAMPANHA
-- WHERE DESCRICAO = 'Easy Breezy Emailmkt \& Eu';

And a third option, similar to the first one would be:

 SELECT * 
      FROM MARK_CAMPANHA
    -- WHERE DESCRICAO = 'Easy Breezy Emailmkt'||chr(38)||' Eu';
    
19.07.2017 / 21:11
1

Dude the best option would be to switch off the Define oracle that has this variable call function. Then you execute the query.

SET DEFINE OFF;

After you can call: SET DEFINE ON;

obs: This set only occurs in your user session, by default the define oracle is always ON.

Hugs

    
03.10.2018 / 20:06