Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Prevent Insert 1

Status
Not open for further replies.

AOT

Programmer
Nov 14, 2002
2
AU
I'm an absolute Oracle novice but I'm designing a simple DB for Uni. I have a form which shows existing records on a single record basis. I've prevented insert at the data block level but included a 'New' button which changes the block's allow insert property and pre-defines a code into a read only field.

I have a post_block trigger which returns the allow insert to false for the block but I can't stop user's from navigating (arrow keys) to another new record once they've clicked the 'New' button. This causes my code to fail.

All I want to do is keep them on the current record until they click the 'Save' button.

Can anyone please help?

Regards AOT
 
The way you're doing this could be a can of worms as I assume you would want to prevent any kind of navigation after the user has clicked on 'New'.

However, you can do what you're asking for by redefining the KEY-DOWN and KEY-UP triggers for the block:

IF :SYSTEM.QUERY_MODE NOT IN ('NEW','CHANGED')
THEN
Down; -- or Up;
END IF;

You may also consider doing this for KEY-NXTREC, KEY-PRVREC, KEY-NXTBLK etc.

My preferred way of doing what you want is to have the form pop up a new dialogue window and force the user to enter any new values into the dialogue. When they click OK the data is validated and entered into the database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top