HOW TO MAKE CUSTOM LOGIN AUTHENTICATION IN ORACLE APEX.
#oracleapex #oracle #apex #sql #sqlqueries #plsql #oraclemessages #apex #oracleapex22.1.3
Code:
/*******Create Table******/
CREATE TABLE "LOGIN_USERS"
( "ID" NUMBER,
"USERNAME" VARCHAR2(50),
"PASSWORD" VARCHAR2(50),
CONSTRAINT "LOGIN_USERS_PK" PRIMARY KEY ("ID")
USING INDEX ENABLE
)
/
CREATE OR REPLACE EDITIONABLE TRIGGER "BI_LOGIN_USERS"
before insert on "LOGIN_USERS"
for each row
begin
if :NEW."ID" is null then
select "LOGIN_USERS_SEQ".nextval into :NEW."ID" from sys.dual;
end if;
end;
/
ALTER TRIGGER "BI_LOGIN_USERS" ENABLE
/
/*******Function Code******/
create or replace FUNCTION LOGIN_USERS_AUTH
(p_username in varchar2, p_password in varchar2)
return boolean
as
user_check varchar2(1);
begin
select 'x'
into user_check
from LOGIN_USERS
where upper(USERNAME) = upper(p_username) and PASSWORD= p_password;
apex_util.set_authentication_result(0);
return true;
exception when no_data_found then
apex_util.set_authentication_result(4);
return false;
end LOGIN_USERS_AUTH;
Share, Support, Subscribe!!!
Subscribe: / @techertzia798
instagram: / techertzia
About : Techertzia is a YouTube Channel, where you will find technological videos.