Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I escape double quotes in oracle query?

I have some text fields in the oracle table, which have double quotes. How to escape them in a select query, so that I can use it in PHP?

like image 560
user61734 Avatar asked Jan 11 '10 18:01

user61734


2 Answers

Odds are, if you are trying to do this you are dealing with a SQL Injection vulnerability. Please Google this and think about what you're doing.

like image 78
Adam Hawkes Avatar answered Oct 09 '22 09:10

Adam Hawkes


You should be able to do a

SELECT REPLACE(your_column, '"', '\"') AS your_escaped_column
FROM your_table;
like image 2
Peter Lang Avatar answered Oct 09 '22 08:10

Peter Lang