Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Insert String values with apostrophes ...

161723Jan 15 2002
How can I insert String values containing apostrophes into a database when using embedded SQL in Java?

Example:
INSERT INTO EMPLOYEE (NAME) VALUES (\'" + getEmployeeName + "\')

where getEmployeeName contains the String value "O'Conell".

At the moment Oracle handles the "O" part only and complains about a missing comma for the 2nd part.

Adding INSTR or SUBSTR does not solve the problem because those require multiple arguments.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2002
Added on Jan 15 2002
4 comments
1,844 views