How to replace "'"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to replace "'"

Stephan Wiesner-2
Hi list,
I hava an application where let my users enter data. If they enter special
characters, like é, they are correctly stored as \u00e8.
This does not work with the single quote ', though. If a user enters this
data, the SQL can not be executed.
What shoudl I do about this? I tried to replace it with \u0027, which is the
unicode representation of the quote, but it did not work.

Stephan

--
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|

Re: How to replace "'"

Perroud Benoit
You have to double the single quote -> ''

yourString.ereg_replace("'", "''")

Regards,

Benoit.

Stephan Wiesner a écrit :

> Hi list,
> I hava an application where let my users enter data. If they enter special
> characters, like é, they are correctly stored as \u00e8.
> This does not work with the single quote ', though. If a user enters this
> data, the SQL can not be executed.
> What shoudl I do about this? I tried to replace it with \u0027, which is the
> unicode representation of the quote, but it did not work.
>
> Stephan
>

--
Etre libre ou mourir



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|

Re: How to replace "'"

Thomas Kellerer
Or use PreparedStatement

Thomas

On 23.08.2005 10:40 Perroud Benoit wrote:

> You have to double the single quote -> ''
>
> yourString.ereg_replace("'", "''")
>
> Regards,
>
> Benoit.
>
> Stephan Wiesner a écrit :
>
>> Hi list,
>> I hava an application where let my users enter data. If they enter
>> special
>> characters, like é, they are correctly stored as \u00e8.
>> This does not work with the single quote ', though. If a user enters this
>> data, the SQL can not be executed. What shoudl I do about this? I
>> tried to replace it with \u0027, which is the
>> unicode representation of the quote, but it did not work.
>>
>> Stephan
>>
>



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|

RE: Re: How to replace "'"

Stephan Wiesner-3
Thanks, that works fine :-)

Stephan

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> Thomas Kellerer
> Sent: Dienstag, 23. August 2005 12:07
> To: [hidden email]
> Subject: [Hsqldb-user] Re: How to replace "'"
>
> Or use PreparedStatement
>
> Thomas
>
> On 23.08.2005 10:40 Perroud Benoit wrote:
> > You have to double the single quote -> ''
> >
> > yourString.ereg_replace("'", "''")
> >
> > Regards,
> >
> > Benoit.
> >
> > Stephan Wiesner a écrit :
> >
> >> Hi list,
> >> I hava an application where let my users enter data. If they enter
> >> special characters, like é, they are correctly stored as \u00e8.
> >> This does not work with the single quote ', though. If a
> user enters
> >> this data, the SQL can not be executed. What shoudl I do
> about this?
> >> I tried to replace it with \u0027, which is the unicode
> >> representation of the quote, but it did not work.
> >>
> >> Stephan
> >>
> >
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference &
> EXPO September 19-22, 2005 * San Francisco, CA * Development
> Lifecycle Practices Agile & Plan-Driven Development *
> Managing Projects & Teams * Testing & QA Security * Process
> Improvement & Measurement * http://www.sqe.com/bsce5sf 
> _______________________________________________
> Hsqldb-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user
>
>




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user