title: pl/sql project password change
body: <p>this is my first pl/sql database project, so I am not experienced but need to start somewhere, I am writing a procedure for a update statement of customer table cpw which the user need to enter the username, if that match the cusername column the they will enter the old password, if that match with the cpw of the same row, then the system will update the new password which is prompt and accepted. here's what i have so far. any help will be appreciated.</p>
  
  <pre><code>CREATE OR replace PROCEDURE Changepassword (input_cusername IN VARCHAR, 
                                              old_cpw         IN VARCHAR, 
                                              new_cpw OUT VARCHAR) 
  IS 
    DECLARE 
      c_username customer.cusername%TYPE; 
      c_cpw customer.cpw%TYPE; 
    BEGIN 
      ACCEPT input_cusername VARCHAR(40) prompt 'Username: ' 
      ACCEPT old_cpw         VARCHAR(20) prompt 'Enter Your Old Password:' 
      ACCEPT new_cpw         VARCHAR(20) prompt 'Enter Your New Password:' 
      UPDATE customer 
      SET    cpw = new_cpw 
      WHERE  cusername = input_cusername; 
  
    EXCEPTION 
    WHEN input_cusername &lt;&gt; c_username customer.cusername%TYPE THEN 
      dbms_output.put_line('no such user exist'); 
    WHEN old_cpw &lt;&gt; cpw FROM customer WHERE cusername = input_cusername THEN 
      dbms_output.put_line('Password Incorrect'); 
    END;
  </code></pre>