Skip to Main Content

Oracle Database Discussions

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!

Finding location of single quote ( ' ) in a string

798590Mar 21 2011 — edited Mar 21 2011
Hi,

I have a need to find the location of second single quote in a string.

Below query works fine for a string without single quote. It gives me the location of word 'HIER' for 2nd occurrence.

select instr('HIER A HIER B','HIER',2) from dual

I want to do the same with single quote. I am trying with the below query.

select instr('HIER A '' HIER B ''',chr(39),2) from dual

But it always gives me the location of first occurrence of single quote and not the second.

Any idea about this issue..?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2011
Added on Mar 21 2011
7 comments
685 views