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

ghz 1years ago ⋅ 2149 views

Question

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

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](http://blog.andrewbeacock.com/2008/09/using-ampersands-without- variable_15.html).