Oracle: How to handle a single quote

1136970 pts.
Tags:
Oracle
SQL
Would I be able to insert a record in a column that has VARCHAR data type with a single quote in it? Or should I use two single-quotes?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Of course you can.

You just need to escape it with another single quote.

So, for example, if you want to insert something like:

This is Luke’s house

You write your INSERT statement like this:

INSERT INTO my_table VALUES ('This is Luke''s house');

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: