Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: single quote
Ong Chin Hui wrote:
>
> Hi, I am using Java and Oracle RDBMS.
>
> When forming the SQL statements for call to Oracle, some statements
> cause error because of existence of single quote in some columns.
>
> Eg. insert into COMPANY values ( 'SAN'ANGLE', ... )
>
> Instead of scanning for single quote, is there any easy way out ?
No, _I_ don't think there is an easy way out.
You _have_ to scan the input an replase the each single qoutes by
'||chr(39)||'
or by
'' (two single quotes).
I don't know which one of these is easier in Java.
Please let me know, how you solved your problem finaly.
Happl from Switzerland Received on Tue Oct 21 1997 - 00:00:00 CDT