list of characters [message #263495] |
Thu, 30 August 2007 03:35 |
palmer18
Messages: 6 Registered: June 2007
|
Junior Member |
|
|
Hi, I need to replace characters ?,+,% in one column for _
CREATE OR REPLACE PROCEDURE replace1 IS
tm char;
BEGIN
FOR tm IN ('?', '+', '%') LOOP
UPDATE Employees
SET owner_name = Replace(owner_name, tm, '_');
END LOOP;
but this doesn´t work
can you help me with this please ?
|
|
|
|
|
|
Re: list of characters [message #263514 is a reply to message #263507] |
Thu, 30 August 2007 04:08 |
palmer18
Messages: 6 Registered: June 2007
|
Junior Member |
|
|
is it possible to use something like numlist ? but for characters
like this:
DECLARE
TYPE NumList IS VARRAY(20) OF NUMBER;
depts NumList := NumList(10, 30, 70); -- department numbers
BEGIN
FORALL i IN depts.FIRST..depts.LAST
UPDATE ....
END;
|
|
|
|
Re: list of characters [message #263520 is a reply to message #263514] |
Thu, 30 August 2007 04:19 |
|
Soumen Kamilya
Messages: 128 Registered: August 2007 Location: Kolkata
|
Senior Member |
|
|
Try with this:
CREATE OR REPLACE PROCEDURE replace1 IS
cursor c1 is
(select '?' replace_char from dual
union
select '+' replace_char from dual
union
select '%' replace_char from dual);
BEGIN
FOR tm in c1 LOOP
UPDATE Employees
SET owner_name = Replace(owner_name, tm.replace_char, '_');
END LOOP;
end;
[Updated on: Thu, 30 August 2007 04:19] Report message to a moderator
|
|
|
|
|