Oracle: Escape ampersand (&) characters in SQL*Plus
When importing a backup you might have run into the problem that the ampersands (&) or colon () characters are used as bind variables in PL/SQL. This is actually no real problem, as you can simply change the substitution character using the DEFINE setting in SQL*Plus:
SET DEFINE ~
The usual substitution mechanism an ampersands would trigger, is now suppressed.
Other methods:
Define an escape character:
SET ESCAPE '\' SELECT '\&abc' FROM dual;
Don’t scan for substitution variables:
SET SCAN OFF SELECT '&ABC' x FROM dual;
Another way to escape the & would be to use concatenation, which would not require any SET commands -
SELECT 'Laurel ' || '&' || ' Hardy' FROM dual;
Use the 10g Quoting mechanism:
Syntax
q'[QUOTE_CHAR]Text[QUOTE_CHAR]'
Make sure that the QUOTE_CHAR followed by an ' doesn't exist in the text.
SELECT q'{This is Orafaq's 'quoted' text field}' FROM DUAL;
You can also turn off substitutions by setting define to off:
SET DEFINE OFF
When you need it, just turn it on again:
SET DEFINE ON
Reference:
http://kwatog.com/blog/oracle/enable-disable-bind-variable-in-sqlplus/