Home » Developer & Programmer » Forms » query question
query question [message #86942] Mon, 22 November 2004 14:39 Go to next message
Ahmed
Messages: 36
Registered: November 2000
Member
Hi,

How can I alert to 'no data retrieved from the query',

because when I query for wrong data the oracle form displayed predefined error message with this code:FM-40301, so I wrote it in the On-error trigger on the form level and I didn't work, I mean it doesn't display my custom alert when no data retrieved. This is the code that I wrote : Trigger:ON-ERROR LEVEl:FORM:

if error_code=40301 then

message('No data retrieved');

end if;

And I want the form displays my custom alert then abort the query, so the user can enter a new query.

Thanks a lot.

/*************/

 
Re: query question [message #86946 is a reply to message #86942] Mon, 22 November 2004 19:04 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
Create a trigger on-message in your Form at Form level & write following code in it.

If Message_code = 40350 Then
Message('I: No record exists for the query criterion entered.',NO_ACKNOWLEDGE);
End If;

HTH
Regards
Himanshu
Re: query question [message #86964 is a reply to message #86942] Wed, 24 November 2004 04:37 Go to previous message
rama krishna
Messages: 97
Registered: December 2001
Member
Please have an exception Block in the Place where ur Select Statement is there.
If no rows are returned from the Select Statement automatically NO_DATA_FOUND Exception raises..u can give ur custome Message there...

Cheers
Ram
Previous Topic: how to calculate time
Next Topic: how to check if a number field is a number?
Goto Forum:
  


Current Time: Sat Sep 07 15:57:42 CDT 2024