While attempting to execute SQL insert statements using Oracle SQL Developer I keep generating an "Enter substitution value" prompt:
insert into agregadores_agregadores ( idagregador, nombre, url ) values ( 2, 'Netvibes', 'http://www.netvibes.com/subscribe.php?type=rss\&url=' );
I've tried escaping the special character in the query using the '\' above but I still can't avoid the ampersand, '&', causing a string substitution.
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.
There are 3 ways to do so : 1) Simply do SET DEFINE OFF; and then execute the insert stmt. 2) Simply by concatenating reserved word within single quotes and concatenating it. E.g. Select 'Java_22 ' || '& '|| ':' || ' Oracle_14' from dual --(:) is an optional.
Querying Escape Characters Everything between the opening brace and the closing brace is part of the escaped query expression (including any open brace characters). To include the close brace character in an escaped query expression, use }} . To escape the backslash escape character, use \\ .
Oracle recommends that you enclose parameter and value pairs in double quotation marks. These special characters must be escaped using double quotation marks (") around the special character or around the parameter value containing the special character.
the &
is the default value for DEFINE
, which allows you to use substitution variables. I like to turn it off using
SET DEFINE OFF
then you won't have to worry about escaping or CHR(38).
|| chr(38) ||
This solution is perfect.
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