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!

How to escape single quote characters in string variable

user1042372Oct 9 2014 — edited Oct 9 2014

I have a requirement to escape any single quote in given string.

I am trying to test the following example.

Can you give me the correct syntax to achieve this.

Here is an example:

declare

v_sql varchar2(100);

begin

v_sql := 'Iam here';

dbms_output.put_line('string is '||q'[v_sql]');

end;

Any help would be appreciated,

Kindest Regards,

Naga

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 6 2014
Added on Oct 9 2014
2 comments
2,768 views