在 oracle apex 中创建自定义身份验证时出错
ERROR creating Custom authentication in oracle apex
我是 Apex 的新手,我正在尝试创建自定义身份验证。
下面是我正在使用的身份验证功能:
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;
我正在使用的用户 table 有三列
- "id",
- "username",
- "password"
下面是我在尝试验证 PL/SQL 块中的函数时看到的错误。
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,
谢谢。
在 apex.oracle.com(顶点 5.0)上:这看起来确实像一个错误。但这并不能阻止您保存该方案。只需创建或应用,它就会正确验证您的代码块并显示任何正确和相关的错误。最好在官方论坛上报告此问题,或者如果您通过官方支持获得支持标识符。
另请注意,您的认证功能不正确。这里有一些相关信息,您也可以通过查看该项目的帮助来查看:
Specify the name of the function that will verify the user's username
and password, after they were entered on a login page. If you enter
nothing, you allow any username/password to succeed. The function
itself can be defined in the authentication's 'PL/SQL Code' textarea,
within a package or as a stored function.
This function must return a boolean to the login procedure that calls
it. It has 2 input parameters 'p_username' and 'p_password' that can
be used to access the values an end user entered on the login page.
你的输入参数必须是上面提到的那两个!
我是 Apex 的新手,我正在尝试创建自定义身份验证。
下面是我正在使用的身份验证功能:
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;
我正在使用的用户 table 有三列
- "id",
- "username",
- "password"
下面是我在尝试验证 PL/SQL 块中的函数时看到的错误。
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,
谢谢。
在 apex.oracle.com(顶点 5.0)上:这看起来确实像一个错误。但这并不能阻止您保存该方案。只需创建或应用,它就会正确验证您的代码块并显示任何正确和相关的错误。最好在官方论坛上报告此问题,或者如果您通过官方支持获得支持标识符。
另请注意,您的认证功能不正确。这里有一些相关信息,您也可以通过查看该项目的帮助来查看:
Specify the name of the function that will verify the user's username and password, after they were entered on a login page. If you enter nothing, you allow any username/password to succeed. The function itself can be defined in the authentication's 'PL/SQL Code' textarea, within a package or as a stored function.
This function must return a boolean to the login procedure that calls it. It has 2 input parameters 'p_username' and 'p_password' that can be used to access the values an end user entered on the login page.
你的输入参数必须是上面提到的那两个!