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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Entering NOT NULL data non-sequentially

Status
Not open for further replies.

scomfort

Programmer
Dec 3, 2003
44
GB
Hey there,

I was wondering how you can make it possible to allow the user to enter in data in no particular order. At the moment I have various questions whos data fields are NOT NULL. However they have to be filled out in order but I would like the user to be able to navigate to any question. Of course once they commit an error message will come up if it has been left blank. Is this possible?
Thanks.
 
Can you give us more info please? Such as, what application are you using to control the input?

In SQL you can insert into the table is any column order you like (assuming that is what you meant.

[tt]INSERT INTO table1 (
COLUMN1,
COLUMN5,
COLUMN3,
COLUMN4,
COLUMN2 )
VALUES (
1,
5,
3,
4,
2 );[/tt]

The column list can be in any order but the data must be in the same order as the columns.

In Oracle Forms you can arrange the fields on the form in any order you want and Forms will construct an insert statement like the one above when you commit the data. You can switch off the automatic checking of NOT NULL fields for entering data, but you must write a trigger to trap mandatory fields before committing.
 
Hey lewisp,

Sorry it was for Oracle Forms 9i.
Basically the user is greeted with several questions, some of which they must answer (say for in this instance its their surname and forename). Of course once they come to a question they must answer (i.e. one which is NOT NULL) they have to answer it there and then and are not allowed to navigate to another question. It is this which I am trying to by-pass but at the same time keep the constraint that they must answer the question once they press the commit button.
I think what you stated in the last line of your reply is what I need to do but I'm not entirely sure how to do this.
 
Hi,

I am forms 6i user
If my understanding is correct what u r asking is u don't want to validate the fields then and there. You want to do the validation just b4 u save and prompt the user to enter the field.

U can remove the NULL validation in the item level and in the item level u can use

WHEN VALIDATE ITEM
IF block.item IS NOT NULL THEN
-- Do other validations......
END IF;

Before issuing a COMMIT u can check in the when button pressed or ON-COMMIT trigger whether that item/field is null if it is NULL just go to that field and say
RAISE FORM TRIGGER FAILURE

I think this will help u.....
Pls ignore if this is not u want
 
Thanks for the help.
Mahesh: yes that is exactly what I wanted to do. I removed the NULL validation triggers and put them into the when_button_pressed commit trigger and set the property of each item to not required. Now I am able to enter in any order but the checking is still done at the end. This may be going off the topic but how do you get a relevant error message pop-up saying "data must be entered in field xx" instead of the un-helpful error message you get at the bottom of the screen? Do you have to create alerts to do this?
Sem: I did what you said also and worked fine, although I wanted some checking to be done at item level such as making sure it was the right data-type. Sorry I didnt make that clear earlier.
 
If you have a multi-record block then the validation triggers should not be be in the WHEN-BUTTON-PRESSED trigger. I suggest placing it at the validate record level.

To display a message, if you do not want to use an alert, you may use:
Code:
message('Message text...');
synchronize;
I suggest placing the synchronize behind the message so that the message is issued immediately rather than waiting until all processing is completed.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top