How do I ignore ampersands in a SQL script running from SQL Plus?

JoshL picture JoshL · Sep 23, 2008 · Viewed 177.4k times · Source

I have a SQL script that creates a package with a comment containing an ampersand (&). When I run the script from SQL Plus, I am prompted to enter a substitute value for the string starting with &. How do I disable this feature so that SQL Plus ignores the ampersand?

Answer

Austin Salonen picture Austin Salonen · Sep 23, 2008

This may work for you:

set define off

Otherwise the ampersand needs to be at the end of a string,

'StackOverflow &' || ' you'

EDIT: I was click-happy when saving... This was referenced from a blog.