views:

7767

answers:

3

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
You can also specify this in the glogin.sql site profile setup file or the login.sql user profile setup file
David Aldridge
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 )

A: 

thank you it works

bhavesh