Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query Help - String in where clause has & character

I am running an SQL (Oracle) statement like that

select * from table 
where table_id in ('265&310', '266&320')

While running through TOAD, it consider & as some variable placeholder and it asks for its value. If it was for 1-2 place holders then I could have set it in TOAD but the in clause has like 200 of strings.

How to put this query?

I want to export the DATASET as SQL INSERT statement, so I can't use this in SQL-PLUS.

like image 840
x.509 Avatar asked Feb 16 '11 18:02

x.509


1 Answers

SET DEFINE OFF;

Will work to turn the prompting for variable off..

or

SET ESCAPE ON;
SELECT 'blah \& blah' AS DES FROM DUAL;
like image 151
Randy Avatar answered Sep 28 '22 09:09

Randy