"ORA-01422: exact fetch returns more than requested number of rows"
You should try to catch exception TOO_MANY_ROWS within your exception handling.
HTH
Gerald
Main Topics
Browse All TopicsWhen 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
enabled, property_true);
set_item_property('patient
enabled, property_true);
set_item_property('physici
enabled, property_true);
set_item_property('medical
enabled, property_true);
set_item_property('transfu
enabled, property_true);
set_item_property('informe
enabled, property_true);
set_item_property('exit',
enabled, property_true);
elsif
v_privilege = 'tegnologo' then
set_item_property('bloodco
enabled, property_true);
set_item_property('patient
enabled, property_true);
set_item_property('physici
enabled, property_false);
set_item_property('medical
enabled, property_true);
set_item_property('transfu
enabled, property_true);
set_item_property('informe
enabled, property_false);
set_item_property('exit',
enabled, property_true);
elsif
v_privilege = 'recepcion' then
set_item_property('bloodco
enabled, property_false);
set_item_property('patient
enabled, property_true);
set_item_property('physici
enabled, property_true);
set_item_property('medical
enabled, property_true);
set_item_property('transfu
enabled, property_false);
set_item_property('informe
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
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Try connecting to sqlplus as each of the users above and run the following selects to check how many rows are being returned.
select user_name, u_pass into name1, pass1 from sys.seguridad
where user_name = LTRIM(RTRIM(:user_name));
select u_privilege into v_privilege
from sys.seguridad where user_name = LTRIM(RTRIM(:user_name));
Sorry, should have said you need to replace :user_name with each actual user name in turn, e.g. 'admini'
select user_name, u_pass into name1, pass1 from sys.seguridad
where user_name = LTRIM(RTRIM('admini'));
select u_privilege into v_privilege
from sys.seguridad where user_name = LTRIM(RTRIM('admini'));
Business Accounts
Answer for Membership
by: HenkaPosted on 2005-11-14 at 03:17:39ID: 15286825
I think that the users other than admin have no privilegy on the table sys.seguridad.