Are you trying to do the equivalent of bitwise operations here? If so, I'd change your approach altogether and use actually bit manipulations using the functions that Oracle provides. I've used them for security/role/grouping designs quite successfully in the past and it's much faster than what you may be trying to do. Robert Robert G. Freeman Master Principal Consultant, Oracle Corporation, Oracle ACE Author of various books on RMAN, New Features and this shorter signature line. Blog: http://robertgfreeman.blogspot.com Note: THIS EMAIL IS NOT AN OFFICIAL ORACLE SUPPORT COMMUNICATION. It is just the opinion of one Oracle employee. I can be wrong, have been wrong in the past and will be wrong in the future. If your problem is a critical production problem, you should always contact Oracle support for assistance. Statements in this email in no way represent Oracle Corporation or any subsidiaries and reflect only the opinion of the author of this email. ________________________________ From: Eriovaldo Andrietta <ecandrietta@xxxxxxxxx> To: ORACLE-L <oracle-l@xxxxxxxxxxxxx> Sent: Sat, July 2, 2011 12:46:21 PM Subject: DOUBT - Oracle command to REPLACE data Hi Friends, I have the following issue: I need to store a column VARCHAR2(45). If I am inserting data for first time I can , for example, save something like this: 111110000000000000000000000000000000000000000 When the line exists recorded in the table with the content above, and during my process I must updated the following, considering only character 1: 000000000000000000000000000000101010101010100 The final result must be as below, replacing only the character 1: 111110000000000000000000000000101010101010100 I know that I can do it: WHILE X < Y LOOP FINAL COLUMN := SUBSTR(N) || 1 || .... END LOOP; But is there any other way to do it, like regular expression or another command / instruction ? Regards Eriovaldo