2009 Jul 24 7:18 PM
Hi friends,
I have created a table ZSTUDENT_INFO. and i have created a table maintaince generator for it....
now i have fields...
ZSCHOOL , ZCLASS , ZNAME , ZAGE , ZROLLNO.
now i have school and class as key fieilds....
now my requiremnet is when the user his entering his records
case 1) for same school and class the roll number is unique ie : we cant have 2 persons with same roll numbers
for example :
school class name age roll no
Adams 4 rahul 8 2
Adams 5 Rahul 9 2
adams 4 kiran 8 2
ist 2 records are differnet ist record is 4thclass and 2nd record is for 5th class but the rd record is same as ist record...
now in this case the user should not able to save the 3rd record as alredy same record is there..
case 2) when the user is entering the record he should check in the table whetther the same combination alredy exits in teh table or not .. if exists it should give us an error mesage saying data already exits..
How can i do this and where should i do this...
Regards
Satish
2009 Jul 25 2:23 PM
Hi,
Add ZROLLNO as primary key the ... Your problem will be solved...
2009 Jul 24 7:58 PM
You ' ll need to create an event in the table maintainence generator. Go to Environment --> Modifications --> Events in the table maintainence generator.
Here write a code in the new entries event write a select query on the same table z table where you are writing the code.
2009 Jul 24 8:01 PM
Hi satish,
First of all if it is a key field system will take care of giving the duplicate record error.
If you want to do any validations in table maintenance generator. Please check the following links or search the forum
with the Table Maintenace Generator events.
If i misunderstood your requirement, please elaborate the question.
Thanks
2009 Jul 25 2:15 PM
Hi satish, the best n simplest way for you requirement is.. just make roll number also key field. so when ever there is same combination of school , class and roll number it will reject the entry saying "record already exist..."
2009 Jul 25 2:23 PM
Hi,
Add ZROLLNO as primary key the ... Your problem will be solved...
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |