When I try to insert a value which has '&' in TOAD I get a prompt for a substitution variable.
So when I try:
insert into x values('hello & world');
it throws a prompt for substituting the variable 'world'.
I have tried right clicking in the editor and disabling prompt for substitution variables but this seems to work only for Execute Statement (F9) It doesn't work for Execute as script(F5).
I am also aware of using chr(38)
like:
insert into x values('hello '||chr(38)||'world');
but I do not want this. Is there something else that will help me run the script?
If you set escape on, it uses an esape using the backslash. So, backslash ampersand will show you an ampersand. Hope this helps.
Use braces to escape a string of characters or symbols. Everything within a set of braces in considered part of the escape sequence. When you use braces to escape a single character, the escaped character becomes a separate token in the query. Use the backslash character to escape a single character or symbol.
SET DEFINE OFF is a script function so you need to use F5, not F9 to execute. A couple of us are using TOAD v10 while the rest of the company is using TOAD v9.
Use the backslash character to escape a single character or symbol. Only the character immediately following the backslash is escaped.
Try putting set define off
at the beginning of your script. It should work with F5:
set define off; insert into x values('hello & world'); set define on;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With