title: Function to verify username and password in pl/sql
body: <p>I've got a table called BANKCUSTOMER with the following columns:</p>
  
  <pre><code> USERNAME                                  NOT NULL VARCHAR2(11)
   FAMILY_NAME                               NOT NULL VARCHAR2(25)
   NAME                                      NOT NULL VARCHAR2(25)
   PASSWD                                    NOT NULL VARCHAR2(6)
  </code></pre>
  
  <p>I want to make a function which checks in the database if the users USERNAME and PASSWORD matches the data in the database. If the login succeeds then it should print out "Login successful!" otherwise "Wrong username or password!"</p>
  
  <p>I visited a pl/sql tutorial site and came over the following code which i modified a bit so it can work with my database, but there is something I don't understand and that is what <code>z number</code> does and what <code>begin  select 1  into z</code> does. Could someone please explain that for me. </p>
  
  <pre><code>create or replace function log_in(x in varchar2, y in varchar2)   
  return varchar2  
  as  
    z number;  
  begin  
    select 1  
      into z   
      from bankcustomer   
      where username=x   
      and passwd=y;  
    dbms_output.put_line('Login successful!');  
  exception  
  when no_data_found then  
    dbms_output.put_line('Wrong username or password!'); 
  end; 
  </code></pre>
  
  <p>I would like to test the function by writing <code>SELECT log_in() FROM dual;</code> to see if it works. When I write <code>SELECT log_in() FROM dual;</code> I get an error message saying:</p>
  
  <blockquote>
    <p>Error starting at line 1 in command:
    SELECT log_in() FROM dual
    Error at Command Line:1 Column:7
    Error report:
    SQL Error: ORA-06553: PLS-306: wrong number or types of arguments in call to 'LOG_IN'
    06553. 00000 -  "PLS-%s: %s"
    *Cause:<br>
    *Action:</p>
  </blockquote>
  
  <p>How can this be resolved?</p>