oracle-apexsql-pl

Oracle apex authentication schemes login errors


FUNCTION authenticate(p_username IN VARCHAR2,p_password IN VARCHAR2) RETURN 
BOOLEAN 
is
l_count integer;
begin
select count(*)
into   l_count
from   STUDENT, ADMIN, ORGANISATION
WHERE upper(Student.STUDENT_ID, ADMIN.ADMIN_ID, ORGANISATION.ORG_ID) = 
upper(p_username)
AND upper(Student.STUDENT_PASSWORD, ADMIN.ADMIN_PASSWORD, 
ORGANISATION.ORG_PASSWORD) = upper(p_password);
return (l_count > 0);
end;

above is authentication code i have made to get information from multiple tables and use them to authenticate a login. if i just do it for students it works fine but i need multiple types of user to be able to access the software and i cant make multiple authentication schemes run at the same time all table name and column names are correct below is the error i get ORA-06550: line 9, column 7: PL/SQL: ORA-00909: invalid number of arguments ORA-06550: line 6, column 1: PL/SQL: SQL Statement ignored


Solution

  • Wrong syntax. Try

    select count(*) 
    into l_count
    from student,
         admin,
         organisation
    where upper(p_username) in (upper(student.student_id),
                                upper(admin.admin_id),
                                upper(organisation.org_id)
                               )
      and upper(p_password) in (upper(student.student_password),
                                upper(admin.admin_password),
                                upper(organisation.org_password)
                               );