How to run sql query having ‘&’ character in update values

If you are trying to update one value and which is having ‘&’ in it then you might be getting prompts while running the statement in SQL developer.

If you go on pressing OK and skipping those prompts then your value will be updated in the desired table but it will be corrupted.

CONCEPT: By default Oracle treats ‘&’ as a special character that begins a substitution string. This can cause problems when running scripts that happen to include ‘&’ for other reasons.

SET DEFINE ON/OFF : OFF suppresses processing of substitution variables and parameters; ON enables normal processing.

To make the update statement successful you should first run the below Query:

set define off;

******************

Then your update statement goes here:

update EMPLOYEE
set WEBURL=’https://testwebsite.com/guid=098764647849494739&menuID=u75854mfkfnflyrnfmvn8758&sl=u75854mfkfnflyrnfmvn87&cp=true’

Then it will update successfully.

Follow TIBCO Zone on WordPress.com

Leave a Reply

Your email address will not be published. Required fields are marked *

Main Menu