Oracle SQL escape character (for a '&') Oracle SQL escape character (for a '&') oracle oracle

Oracle SQL escape character (for a '&')


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).


Set the define character to something other than &

SET DEFINE ~create table blah (x varchar(20));insert into blah (x) values ('blah&amp');select * from blah;X                    -------------------- blah&amp