I am new to Apex and I am trying to create a custom authentication.
Below is the authenticate function I am using:
FUNCTION authenticate(username_in IN VARCHAR2
,password_in IN VARCHAR2) RETURN BOOLEAN IS
l_value NUMBER;
l_returnvalue BOOLEAN;
BEGIN
BEGIN
SELECT 1
INTO l_value
FROM users
WHERE 1 = 1
AND upper(users.username) = upper(username_in)
AND users.password = password_in;
EXCEPTION
WHEN no_data_found
OR too_many_rows THEN
l_value := 0;
WHEN OTHERS THEN
l_value := 0;
END;
l_returnvalue := l_value = 1;
RETURN l_returnvalue;
END;
The users table I am using has three columns
- "id",
- "username",
- "password"
Below is the error I am seeing when I try to validate the function in PL/SQL block.
ORA-06550: line 1, column 73: PLS-00103: Encountered the symbol "AUTHENTICATE" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "AUTHENTICATE" to continue. ORA-06550: line 1, column 101: PLS-00103: Encountered the symbol "VARCHAR2" when expecting one of the following: ( The symbol "(" was substituted for "VARCHAR2" to continue. ORA-06550: line 2, column 57: PLS-00103: Encountered the symbol "VARCHAR2" when expecting one of the following: ( ORA-06550: line 24,
Thanks.