Izmena lozinke u aplikaciji
Kako bi Vaš korisnik mogao da promeni lozinku kroz aplikaciju,na početnoj stranici kreirajte proces koji se izvršava pritiskom na dugme Izmeni ,a nakon unosa nove lozinke u item :P1_NOVA_LOZINKA:
if :P1_NOVA_LOZINKA is not null then
izmena_lozinke (:P1_NOVA_LOZINKA);
end if;
izmena_lozinke (:P1_NOVA_LOZINKA);
end if;
Procedura izmena_lozinke koja se poziva, kreirana je na bazi:
CREATE OR REPLACE PROCEDURE izmena_lozinke (loz char ) IS
Cursor_Name INTEGER;
String VARCHAR2(100);
cursor USERNAME_CURSOR is
select nvl(v('APP_USER'),User) from DUAL;
UserNm VARCHAR2(32);
pass varchar2(32);
u varchar2(50);
BEGIN
--select user into u from dual;
pass := loz;
open USERNAME_CURSOR;
fetch USERNAME_CURSOR into UserNm;
close USERNAME_CURSOR;
--String := 'ALTER SESSION SET CURRENT_SCHEMA= "'||upper(UserNm)||'"';
String := 'alter user "'||upper(UserNm)||'" identified by "'|| pass ||'"';
Cursor_Name := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(Cursor_Name, String, 1);
DBMS_SQL.CLOSE_CURSOR(Cursor_Name);
--String := 'ALTER SESSION SET CURRENT_SCHEMA= "'||upper(u)||'"';
END;
***Nikada ne gledaj šta nemaš, nego šta imaš.***
Cursor_Name INTEGER;
String VARCHAR2(100);
cursor USERNAME_CURSOR is
select nvl(v('APP_USER'),User) from DUAL;
UserNm VARCHAR2(32);
pass varchar2(32);
u varchar2(50);
BEGIN
--select user into u from dual;
pass := loz;
open USERNAME_CURSOR;
fetch USERNAME_CURSOR into UserNm;
close USERNAME_CURSOR;
--String := 'ALTER SESSION SET CURRENT_SCHEMA= "'||upper(UserNm)||'"';
String := 'alter user "'||upper(UserNm)||'" identified by "'|| pass ||'"';
Cursor_Name := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(Cursor_Name, String, 1);
DBMS_SQL.CLOSE_CURSOR(Cursor_Name);
--String := 'ALTER SESSION SET CURRENT_SCHEMA= "'||upper(u)||'"';
END;
***Nikada ne gledaj šta nemaš, nego šta imaš.***
Нема коментара:
Постави коментар