0

I have a strange situation where the following (sub)query is throwing a variable window due to the WHERE constraint string. Is there any way to beat this? (NOTE: key inputs changed due to proprietary nature of the query)

SELECT /*+ PARALLEL(8) */ x, y AS "SUM PF-07320248 & PF-23456789 NAREA%"
FROM myTable 
WHERE constraintA = 1 AND constraintB LIKE 'abc%' AND constraintC = 'SUM PF-1234678 & PF-23456789'

The "& PF" is the part of the WHERE clause that is throwing the variable window, expecting me to enter something.

JimT
  • 170
  • 13
  • That is not a SQL issue, it is an issue with your client interface (SQL\*Plus, or Toad, etc.) I don't know if this works in Toad; in SQL\*Plus or SQL Developer, the way to "fix" this issue (which is that the ampersand is a marker for substitution variables) is to run the following command **before** the query: `set define off` –  Aug 09 '21 at 19:26
  • Thanks for the quick response @mathguy. This didn't work although it appears supported through Toad 9 or 10. I'm using 11. – JimT Aug 09 '21 at 19:40
  • Using ' || chr(38) || ' in place of the ampersand fixed the problem. – JimT Aug 09 '21 at 19:41

0 Answers0