MattsBits
MattsBits - Brunel District

MattsBits

MattsBits RSS Feed - Subscribe Now!

30/04/2009 : Oracle SQL Developer SQL Worksheet And Ampersands

Categories : | Oracle | Views : 716 | Email Link Print

If you attempt to run SQL queries in a SQL worksheet and that query includes ampersands then SQL Developer will prompt you for bind variable values. It assumes anything starting with an ampersand must be a bind variable.

For example the query below :

SELECT * FROM TBL_COLOURS WHERE colour = 'Red&Blue';


would result in a pop-up window asking for a value for "&Blue".

If you are running a few thousand update queries containing lots of text it is very annoying.

There are 2 ways of avoiding it. Either replace all occurances of & with ' || '&' || '

SELECT * FROM TBL_COLOURS WHERE colour = 'Red' || '&' || 'Blue';


Or use the SQL Plus command :

SET DEFINE OFF;

Technorati Tags : | oracle | plsql | sql | developer | worksheet | ampersands |

Author : Matt Hawkins  Last Edited By : Matt Hawkins  Permalink : Oracle SQL Developer SQL Worksheet And Ampersands
 
 
 
PHP Powered  MySQL Powered  Valid XHTML 1.0  Valid CSS  Firefox - Take Back The Web  EUKHost - Recommended Webhosting Solutions

MattHawkins CMS v2.0 - Copyright 2009-2010