From: Maga via DBMonster.com on
Hi,

When I try to insert data in the Forms, appears the error FRM-40508: Oracle
error: unable to insert record
and automatically return to the logon page.

I have a security table with different users, all of then have the same
problem.

Desc Seguridad;
Name Null? Type
----------------------------------------------------- -------- --------------
----------------------
USER_NAME Not Null 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(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
/*quelquier funcion que yo quiera*/

select u_privilege into v_privilege
from sys.seguridad where user_name = LTRIM(RTRIM(:user_name));
If v_privilege = 'administrativo' then
set_item_property('bloodcomponent',
enabled, property_true);
set_item_property('patient',
enabled, property_true);
set_item_property('physician',
enabled, property_true);
set_item_property('medicalorder',
enabled, property_true);
set_item_property('transfusion',
enabled, property_true);
set_item_property('informes',
enabled, property_true);
set_item_property('exit',
enabled, property_true);
elsif
v_privilege = 'tegnologo' then
set_item_property('bloodcomponent',
enabled, property_true);
set_item_property('patient',
enabled, property_true);
set_item_property('physician',
enabled, property_false);
set_item_property('medicalorder',
enabled, property_true);
set_item_property('transfusion',
enabled, property_true);
set_item_property('informes',
enabled, property_false);
set_item_property('exit',
enabled, property_true);
elsif
v_privilege = 'recepcion' then
set_item_property('bloodcomponent',
enabled, property_false);
set_item_property('patient',
enabled, property_true);
set_item_property('physician',
enabled, property_true);
set_item_property('medicalorder',
enabled, property_true);
set_item_property('transfusion',
enabled, property_false);
set_item_property('informes',
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,
Maga

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/oracle/200511/1
 | 
Pages: 1
Prev: Strange SQL
Next: ORA-01654 Fix?