hai , try this SQL> select * from Mapping; COL1 COL2 -------------------- -------------------- ADF!R2344 DSF!SDF_F@ 1145#R#190 [EMAIL PROTECTED]@145 1123!F!101 1121-F-102 6 rows selected. SQL> select * from Punctuation; C - ! - @ # _ SQL> DECLARE 2 CURSOR C1 IS SELECT rowid , COL1 FROM Mapping; 3 CURSOR C2 IS SELECT COL1 FROM Punctuation ; 4 l_a VARCHAR2(20); 5 BEGIN 6 FOR X1 IN C1 LOOP 7 l_a := X1.COL1; 8 FOR X2 IN C2 LOOP 9 l_a := REPLACE(l_a,X2.COL1,''); 10 END LOOP; 11 UPDATE Mapping 12 set col2 = l_a 13 where rowid = x1.rowid; 14 END LOOP; 15 END ; 16 / PL/SQL procedure successfully completed. SQL> select * from Mapping; COL1 COL2 -------------------- -------------------- ADF!R2344 ADFR2344 DSF!SDF_F@ DSFSDFF 1145#R#190 1145R190 [EMAIL PROTECTED]@145 1123G145 1123!F!101 1123F101 1121-F-102 1121F102 6 rows selected. Hai , U want to update the col2 of mapping table with new value or
On Thu, Nov 20, 2008 at 12:25 PM, Swapna <[EMAIL PROTECTED]> wrote: > Hi Guys, > > There is a table which contains tow columns. > > Table -->Mapping > Col1 | Col2 > ------------------------------------------------------------- > 1121-F-102 | > 1123!F!101 | > [EMAIL PROTECTED]@145 | > 1145#R#190 | > > In another table i will have one column > Table --> Punctuation > Col1 > ------- > - > ! > @ > > I need to write a procedure that will take the values from Punctuation > table and replace those characters in the mapping table Col1 and insert it > into Col2 table. > > But here if i fetch first record from punctuation table and replace them > into mapping there will be only one record in Col2. > > So next level of replacement should happen on Col1. But the problem is > records to replace will not be in the ordered form. > > Other problem exists when there is combination of punctuations in the Col1 > of mapping table. > > Regards, > Swapna > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Oracle PL/SQL" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Oracle-PLSQL?hl=en -~----------~----~----~----~------~----~------~--~---
