Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> escaping all 'weird' chars in SQL statements

escaping all 'weird' chars in SQL statements

From: Otis Gospodnetic <otis_at_my-deja.com>
Date: Mon, 27 Mar 2000 18:21:37 GMT
Message-ID: <8bo8qa$gtc$1@nnrp1.deja.com>


Hello,
I would think my question is a FAQ, but I can't find answers to it on deja.com nor on technet.oracle.com.
I'm wondering if there is a way to escape _all_ characters 'weird' SQL characters, like %, &, _, ', ;, etc. before executing an SQL statement? This is something I would like to do from my java code, so I'm not looking for sqlplus solution. I would also love to be able to do something like this:
sql = "SELECT * FROM my_table WHERE col1='3-4' col2='How?; Here!' "; sql = sql.escapeAllBadChars(sql);
Is this possible?
Thanks,
Otis

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Mar 27 2000 - 12:21:37 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US