Jump to content

i have to write a procedure that takes 2 input parameters.

it will take the domain name part of a email like gmail.com or hotmail.com.

it will look for the first parameter in the database and replace it with the second one. 

 

here is what i have so far.

create or replace procedure PR_Replace_Domainauthid current_user(P_OldDomain Varchar2, P_NewDomain Varchar2)isV_NewDomain Varchar2(129);Cursor C_Domain IS SELECT REGEXP_REPLACE(Email_Address, '[a-zA-Z0-9._%-]+@'|P_OldDomain,'[a-zA-Z0-9._%-]+@'|P_NewDomain,0,in) FROM All_Tables;BEGINOpen C_Domain;loopFetch C_Domain INTO V_NewDomain;EXIT WHEN C_Domain%NOTFOUND;END LOOP;CLOSE C_Domain;END PROCEDURE PR_Replace_Domain;/

im sure this is totally wrong.. but please help?

 

Link to comment
https://linustechtips.com/topic/165472-plsql-helpurgent/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×