如何从不同的表联接多个列是SQL Developer

问题描述

我有一个名为-“ TFA_USERS”的表,它具有用户名,密码和email_id。我有一个视图,该视图基本上从集合中获取数据,即称为代码的视图列,我想基本上将列代码与where子句中的用户名和密码结合起来,我的目标是实现2因子身份验证,这是我的代码,尝试将sql放入我缺少的东西中

create or replace function "tfa_authentication"
    (p_username in VARCHAR2,p_password in VARCHAR2,p_otp_code  in number)
return BOOLEAN
is
        l_user sign_up.user_name%type := upper(p_username);
        l_hash sign_up.set_password%type;
        l_otp  tfa_temp_v.msg%type;
begin
    
    select  user_name,set_password
        into l_user,l_hash
        from tfa_users
        where user_name = p_username and set_password = p_password;

    union  select msg
    into l_otp
    from TFA_TEMP_V
    where msg = p_otp_code;

        RETURN TRUE;
EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
        Apex_Util.Set_Session_State('LOGIN_MESSAGE','User not found');                 
END;

预先感谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)