Friday, March 1, 2019

Filter column with '&' value in Oracle SQL Developer

We had a data dump into oracle, where in a column value had an '&' in it. Say for example a company name like 'Johnson & Johnson'.


What happens now is SQL Developer expects a substitution variable when it encounters an ampersand.

If you have a table and need to filter on the same, you can go with the below script

SELECT * FROM ORGANIZATION WHERE ORG_NAME IN ('Johnson '||chr(38)||' Johnson'

This should prevent SQL Developer from asking you for a substitution variable.

No comments:

Post a Comment