title: Replacing Email Domains
body: <p>I'm trying to change the inputted domain name to a new domain name, for example, "hotmail.com" becomes "outlook.com". I believe I'm on the right track, just my substring is off.</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE PR_ChangeDomain
  (P_Email_Address varchar2)
  IS
  Cursor C_Email IS
    Select Email_Address, Broker_Number
    From Customer
    Where Email_Address = P_Email_Address;
  
    V_Email varchar2(50);
  
  BEGIN
    Open C_Email;
    Fetch C_Email into V_Email;
  
    While C_Email%FOUND LOOP 
    Update Customer 
    Set Email_Address = SUBSTR((Email_Address), V_Email)
    Where Email_Address = P_Email_Address; 
  
    Fetch C_Email into V_Email;
    End Loop;
    Close C_Email;
    End PR_ChangeDomain;
    /
  </code></pre>