Quote:
Fetch C_Domains INTO V_OldDomain;
...
Fetch C_Domains into New_Email;
It looks to me like your second
Fetch
is targeting the wrong variable.
I'd also question why you claim you need a cursor, when you could accomplish this with a single
UPDATE
statement:
UPDATE Customer
SET Email_Address = regexp_replace(Email_Address, '^(.*@.*)'||Old_Email||'\1'||New_Email)
WHERE Email_Address Like '%@'||Old_Email;