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!

apostrophe issues while inserting strings

user12083970Apr 25 2011 — edited Apr 28 2011
We have a quite common case to insert remarks into a REMARKS column of a table which is VARCHAR2(100).
1) How can we insert strings which have a apostrophe like... "office's department". The insert would look like INSERT into ATABLE(REMARKS) values ('abcd office's department'); which would fail with syntax error. So, we have to introduce an extra apostrophe like this... INSERT into ATABLE(REMARKS) values ('abcd office''s department'); and this works. This can be easily done if a Oracle developer is going to insert data. How do you handle cases where appln screens would accept remarks from user and then insert into the database?
2) Our appln reads from the REMARKS column and inserts into another table with a REMARKS column as well. How can this case be handled for similar issues?

thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 26 2011
Added on Apr 25 2011
5 comments
3,530 views