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?
+12
A:
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.
Austin Salonen
2008-09-22 23:25:36
You can also specify this in the glogin.sql site profile setup file or the login.sql user profile setup file
David Aldridge
2008-09-23 14:37:24
A:
According to this nice FAQ there are a couple solutions. You might also be able to escape the ampersand with the backslash character "\" if you can modify the comment.
(hm, linking doesn't seem to work for me. Here is the URL for the faq: http://www.orafaq.com/wiki/SQL*Plus_FAQ#How_does_one_disable_interactive_prompting_in_SQL.2APlus.3F )