Help on Logon [message #305089] |
Sat, 08 March 2008 06:11 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
*munnabhai*
Messages: 157 Registered: March 2008 Location: Riyadh
|
Senior Member |
|
|
Hi guyz,
I have a table Logon
Name Null? Type
------------ -------- ----------------------------
USRNM VARCHAR2(15) UNIQUE
PASWD NOT NULL VARCHAR2(15)
STATUS CHAR(1)
---------------------------------------------------
Data is like this
USRNM PASWD S
--------------- --------------- -
TEST TEST Y
ADMIN ADMIN N
im trying the procedure below on When_button_trigger
when im logging in from the logon form the status should be 'Y'
i mean it should be update the logon table status to 'Y'
and when im exit from main windows the logon status should be 'N'
but it was not update some problem can anyone explain why?
below is the trigger im using?
just i wanna to updat the status let me know how ?
DECLARE
A VARCHAR2(15);
B VARCHAR2(15);
C CHAR(1);
BEGIN
SELECT USRN,PASWD,STATUS INTO A,B,C FROM LOGON
WHERE USRNM=:LOGON.USRNM;
IF A=:USRNM AND B=:PASWD AND C='N' THEN --->(I WANNA TO CHECK HERE THE STATUS OF THE TABLE AND UPDATE THE TABLE TO 'Y')
UPDATE LOGON SET STATUS='Y' WHERE USRNM=A;
COMMIT_FORM;
Message('You have no unsaved changes outstanding.');
CALL_FORM(GETPATH||'MAIN_MENU',HIDE); --> (IF SESSION IS TRUE THEN CALL MAIN_MENU)
CLEAR_RECORD;
RAISE FORM_TRIGGER_FAILURE;
ELSIF C='Y' THEN
MESSAGE('You have already logged on at another Machine !!!!');
ELSE
MESSAGE('Invalid Password or Username !!!');
GO_ITEM('LOGON.USRNM');
END IF;
-- END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
MESSAGE('Invalid Username or Password!!!');
END;
IS THERE SOMETHING WRONG IN THIS TRIGGER LET ME KNOW GUYZ HOW TO UPDATE THE RECORD WITH THIS TRIGGER?
THE ERROR IS (FRM-40735: WHEN BUTTON PRESSED trigger raised unhandled exception 0ra-01403)
Request to all please help me to get out in this....
Regards
EDITED by LF: added [code] tags in order to improve readability. Next time, please, properly format the code and use [code] tags yourself.
[Updated on: Sat, 08 March 2008 10:35] by Moderator Report message to a moderator
|
|
|
Re: Help on Logon [message #305097 is a reply to message #305089] |
Sat, 08 March 2008 07:25 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
varu123
Messages: 754 Registered: October 2007
|
Senior Member |
|
|
Your select into clause does not return any values.
Check whether the username you are login in the form actually has any data in the database
|
|
|
|
|
|