Skip to content

Instantly share code, notes, and snippets.

@sathish-io
Created May 5, 2014 07:38
Show Gist options
  • Save sathish-io/41a7acb9d916c9c3a090 to your computer and use it in GitHub Desktop.
Save sathish-io/41a7acb9d916c9c3a090 to your computer and use it in GitHub Desktop.
Oracle escaping '&' character
some times, you are in need of doing DML operation that involves strings with & sign in it.
Oracle sql clients treats this as a substitution variables and prompts you to enter value.
For example when you run below select statement; it prompts you to enter value for "T".
select 'A&T' from dual;
To disable this you can disable substitution variables for your session using "SET DEFINE OFF"
Note: & is the default value for DEFINE.
SET DEFINE OFF
select 'A&T' from dual;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment