24

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?

3
  • Possible duplicate: stackoverflow.com/questions/5020709/…
    – user1120144
    Commented Sep 11, 2013 at 7:52
  • I am looking for a different solution. The accepted answer says about disabling prompt for substitution variables. But as mentioned in my question I have tried this. Commented Sep 11, 2013 at 7:56
  • 1
    The link I provided has also other answers, not only the accepted solution.
    – user1120144
    Commented Sep 11, 2013 at 7:58

4 Answers 4

37

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;
12

In TOAD version 12.120.39 Right click in Editor and Click in Substitution Variable Prompting and select none

This worked for me.

8

set define off doesn't work in TOAD just in sqlplus.

You can disable substitution variable support by right-clicking in the Editor and unchecking the “Prompt for Substitution Variables” item. It works with F9 execution but not with F5 (script) execution. With F5 you need to add "set define off" in the first line then launch with F5!! (hope this help it was very hard to find for me)

1
  • 1
    I just used SET DEFINE OFF to resolve this issue while using Toad 12.8.0.49 Commented Nov 20, 2018 at 21:37
0

I use toad 16.1 and disabling on editor "Substitution Variable Prompting = none" works all the time

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.