Oracle: Replace single occurrence of a character
-
Hi all, How do you replace a single occurrence of a character in Oracle? For example, how do I replace a single occurrence of the percent sign with a plus sign: 'my string a%a here' should be 'my string a+a here', while 'my string a%%a here' should still remain as 'my string a%%a here'. I know it can be done using REGEXP_REPLACE, but I'm not sure of which regular expression to use to make it replace only a single occurrence. Any help will be appreciated. Thanks
-
Hi all, How do you replace a single occurrence of a character in Oracle? For example, how do I replace a single occurrence of the percent sign with a plus sign: 'my string a%a here' should be 'my string a+a here', while 'my string a%%a here' should still remain as 'my string a%%a here'. I know it can be done using REGEXP_REPLACE, but I'm not sure of which regular expression to use to make it replace only a single occurrence. Any help will be appreciated. Thanks
why don't you rely on occurence of special character.if it more than one,don't replace. simply if-else case.. cheers!!! Vatsa www.objectiveprogramming.com