finance_teacher
asked on
ORACLE -- easy SQL search, special characters ?
How can I get the below to find all 'ACI O&A' records ?
Currently Oracle SQL Developer prompts me since it thinks "&" is a parameter.
select *
from ACTIVITY_TAB
where PROJECT_ID = '161310'
and SUB_PROJECT_ID = 'ACI O&A'
--and SUBSTR(SUB_PROJECT_ID,1,5) = 'ACI O'
Currently Oracle SQL Developer prompts me since it thinks "&" is a parameter.
select *
from ACTIVITY_TAB
where PROJECT_ID = '161310'
and SUB_PROJECT_ID = 'ACI O&A'
--and SUBSTR(SUB_PROJECT_ID,1,5)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, I used an ascii table like the one in your link to identify the decimal value of the ampersand character, so it could be used by the CHR function.
I believe sql developer has the same or similar options.
There is also an ESCAPE but turning off define is the easiest.