When I try to connect with the admini user, don't connect and appears the error frm-40735: when-button-pressed trigger raised unhandled exception ora-01422. When I try to connect with the other users, the connection function very well.
This is my security table and the data of the table.
Desc Seguridad;
Name Null? Type
--------------------------
----------
----------
------- -------- --------------------------
----------
USER_NAME VARCHAR2(20)
U_PRIVILEGE VARCHAR2(25)
U_PASS VARCHAR2(10)
USER_NAME U_PRIVILEGE U_PASS
-------------------- ------------------------- ----------
admini administrativo admini
tegno tegnologo tegno
recep recepcion recep
3 rows selected.
TRIGGER OF THE SUBMIT BUTTON(WHEN-BUTTON-PRESSED
)
Declare
name1 varchar2(20);
pass1 varchar2(10);
v_privilege varchar2(20);
begin
if :user_name is null then
message('Favor de no dejar espacios sin llenar');
Raise form_trigger_failure;
end if;
if :u_pass is null then
message('Favor de no dejar espacios sin llenar');
Raise form_trigger_failure;
end if;
select user_name, u_pass into name1, pass1 from sys.seguridad
where user_name = LTRIM(RTRIM(:user_name));
if :user_name = LTRIM(RTRIM(name1)) and :u_pass = LTRIM(RTRIM(pass1))
then
/*Any function*/
select u_privilege into v_privilege
from sys.seguridad where user_name = LTRIM(RTRIM(:user_name));
If v_privilege = 'administrativo' then
set_item_property('bloodco
mponent',
enabled, property_true);
set_item_property('patient
',
enabled, property_true);
set_item_property('physici
an',
enabled, property_true);
set_item_property('medical
order',
enabled, property_true);
set_item_property('transfu
sion',
enabled, property_true);
set_item_property('informe
s',
enabled, property_true);
set_item_property('exit',
enabled, property_true);
elsif
v_privilege = 'tegnologo' then
set_item_property('bloodco
mponent',
enabled, property_true);
set_item_property('patient
',
enabled, property_true);
set_item_property('physici
an',
enabled, property_false);
set_item_property('medical
order',
enabled, property_true);
set_item_property('transfu
sion',
enabled, property_true);
set_item_property('informe
s',
enabled, property_false);
set_item_property('exit',
enabled, property_true);
elsif
v_privilege = 'recepcion' then
set_item_property('bloodco
mponent',
enabled, property_false);
set_item_property('patient
',
enabled, property_true);
set_item_property('physici
an',
enabled, property_true);
set_item_property('medical
order',
enabled, property_true);
set_item_property('transfu
sion',
enabled, property_false);
set_item_property('informe
s',
enabled, property_false);
set_item_property('exit',
enabled, property_true);
end if;
null;
else
message('El nombre de usuario o la contraseña están incorrectos');
raise form_trigger_failure;
end if;
exception
when no_data_found then
message('El nombre de usuario o la contraseña están incorrectos');
raise form_trigger_failure;
end;
Clear_block;
GO_BLOCK('PRINCIPAL');
Thanks,
natucoqui
Start Free Trial