Controlling Variable Substitution
As you use SQL*Plus, two problems will eventually arise concerning the use of substitution variables. The first problem you are likely to encounter is that you will need to use an ampersand somewhere in your script, and you won’t mean for it to be part of a substitution variable name. This is a very common problem, and happens most often when you’re using an ampersand in a quoted string or as part of a comment.
The second problem, which you may never encounter at all, is that you may want to place a substitution variable smack in the middle of a word. This is a less common problem, and may not be an issue at all depending on the types of scripts you write.
SQL*Plus provides several ways to deal with these problems. A special escape character can be used whenever you need to place an ampersand in your script and have it stay there. A concatenation character is provided for those unusual cases where you want to place a substitution variable at the beginning or middle of a word. You can change the substitution character entirely if you don’t like using the ampersand and want to use some other character instead. Finally, if you aren’t really into writing scripts, you can turn the substitution feature completely off. Then you won’t have to worry about it at all.
The Escape Character
The escape character preceding an ampersand tells SQL*Plus to leave it alone — that it is not part of a substitution variable. Consider the following DEFINE command: ...