- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All Topicshello, i want help
i make a button in form of forms 6i. i make a trigger on this button 'when_button_pressed.and in it i wrote abort_query. but when i run the form and it is in query mode and i press the button it don't cancel the query but gives the message that 'last record retrieved'. please help me and tell me the valid way to put the cancel query button on my form.
regards.
Khalid Majeed
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.
Business Accounts
Answer for Membership
by: adixitPosted on 2004-01-08 at 02:21:31ID: 10069965
abort_query
--------------
Description: Closes a query that is open in the current block.
A query is open between the time the SELECT statement is issued and the time when all the rows have been fetched from the database. In particular, a query is not open when the form is in Enter Query mode, because the SELECT statement has not yet been issued.
Syntax PROCEDURE ABORT_QUERY;
Built-in Type unrestricted procedure
Enter Query Mode yes
A query is open between the time the SELECT statement is issued and the time when all the rows have been fetched from the database. In particular, a query is not open when the form is in Enter Query mode, because the SELECT statement has not yet been issued.
Usage Notes
ABORT_QUERY is not the equivalent of the Query, Cancel runtime default menu command. It does not prevent the initial fetch from the database, but rather interrupts fetch processing, thus preventing subsequent fetches
RESTRICTIONS:
Do not use ABORT_QUERY in the following triggers:
on-Fetch. The On-Fetch trigger is provided for applications using transactional triggers to replace default Form Builder functions when running against non-Oracle data sources. To signal that your On-Fetch trigger is done fetching rows, exit the On-Fetch trigger without issuing the CREATE_QUERIED_RECORD built-in.
Pre-Query. The Pre-Query trigger fires before the query is open, so there is no open query to close and ABORT_QUERY is ignored. To programmatically cancel Enter Query mode, call the built-in EXIT_FORM, using a When-New-Record-Instance trigger to check a flag as follows:
IF (:global.cancel_query = 'Y'
and :system.mode = 'ENTER-QUERY')
THEN
Exit_Form;
:global.cancel_query = 'N';
END IF;
Then set the flag to 'TRUE' either from a Pre-Query trigger or an On-Error trigger that traps for the FRM-40301 error.