Home » SQL & PL/SQL » Client Tools » escape/quote Ampersand (&) because no variable substitution
escape/quote Ampersand (&) because no variable substitution [message #502275] Tue, 05 April 2011 09:26 Go to next message
oranooob
Messages: 86
Registered: May 2009
Member
Hi

I wish to replace the string "Benutzername&Kontakt" with nothing.

SELECT REPLACE (role_owner, 'Benutzername&Kontakt', '')
  FROM JC_NAME_62
 WHERE jc_name LIKE 'SAP_R4_BIN5\_%' ESCAPE '\'


But my Toad prompts me always to fill in the variable. I don't wish to do that, I wish to escape the &

http://i.imgur.com/m1MuT.png
Re: escape/quote Ampersand (&) because no variable substitution [message #502277 is a reply to message #502275] Tue, 05 April 2011 09:29 Go to previous messageGo to next message
cookiemonster
Messages: 13017
Registered: September 2008
Location: Rainy Manchester
Senior Member
There will be a setting in TOADs preferences somewhere to switch that off.
Otherwise you could use the chr function to put the & in. TOAD won't notice that way.
Re: escape/quote Ampersand (&) because no variable substitution [message #502280 is a reply to message #502277] Tue, 05 April 2011 09:38 Go to previous messageGo to next message
oranooob
Messages: 86
Registered: May 2009
Member
thanks

Does this means the same SQL would work in SQLplus? Its only a toad problem?
Re: escape/quote Ampersand (&) because no variable substitution [message #502281 is a reply to message #502280] Tue, 05 April 2011 09:44 Go to previous messageGo to next message
BlackSwan
Messages: 25858
Registered: January 2009
Location: SoCal
Senior Member
>Does this means the same SQL would work in SQLplus? Its only a toad problem?
what happens when you actually try it YOURSELF?
Re: escape/quote Ampersand (&) because no variable substitution [message #502299 is a reply to message #502280] Tue, 05 April 2011 11:09 Go to previous messageGo to next message
Michel Cadot
Messages: 65389
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
oranooob wrote on Tue, 05 April 2011 16:38
thanks

Does this means the same SQL would work in SQLplus? Its only a toad problem?

Yes.

Regards
Michel

Re: escape/quote Ampersand (&) because no variable substitution [message #502356 is a reply to message #502299] Wed, 06 April 2011 01:35 Go to previous message
Littlefoot
Messages: 21367
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As of the original question: the answer might depend on TOAD version, but - generally - you should right-click in the Editor window and set (or not) the "Prompt for substitution variables" mark.
Previous Topic: how to execute stored Procedure with cursor with in pl/sql
Next Topic: Having multiple input values
Goto Forum:
  


Current Time: Sun Feb 25 04:24:20 CST 2018

Total time taken to generate the page: 0.04071 seconds