Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Samir H.
  Where is Samir H.?
 Yogyakarta
 Indonesia
 Samir H.
 To: Mike Yearwood
  Where is Mike Yearwood?
 Toronto
 Canada
 Mike Yearwood
 Tags
Subject: RE: Composed Index as primary key?
Thread ID: 268913 Message ID: 269024 # Views: 24 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Friday, July 16, 2010 6:16:14 AM         
   


> >
> > Hi Cetin,
> > It looks like Tushar & Mike also think better use single indexes. So I changed my code to seek()+scan.
> >
> >
select myTable
> > set order to tag studentID
> > if seek(m.nStud)
> >    scan ;
> >         FOR subjectID = m.nSubj and semesterID = m.nSemesterID ;
> >         WHILE studentID = m.nStud		
> >      	* do nothing!
> >      	EXIT 
> >    endscan
> > endif
> > thisform.edtComments.value=myTable.comments		&& memo-field
> > RETURN
> > * If I don't want to give any feedback to the user, it seems that there's no need
> > * to check for eof(). -> myTable.comments would just be an empty string if eof()=.t.
> > * or do you see the need to do following?
> > IF !EOF()
> > 	thisform.edtComments.value=myTable.comments		&& memo-field
> > ELSE 
> > 	thisform.edtComments.value=''
> > ENDIF

> >
> > Last question(?) in this thread :)
> > Would you still recommend a candidate composite "BINTOC(subj)+BINTOC(stud)+BINTOC(semester)" just to enforce uniqueness of records? The application should actually take care of that. But your applications do too, do you then still make a given index candidate?
> >
> >
> > Regards
> > Samir
>
> I add data integrity rules (like that one) to the database, rather than in the business rules or UI.
>
> Mike Yearwood
> Microsoft MVP Visual FoxPro 2008, 2009
> We have enough youth. We need a fountain of smart!
> There may be many ways to skin a cat, but there are very few right ways to do it.

Thank you. I hope I can soon find the time to start learn and implement such rules in the database.

Regards
Samir

ENTIRE THREAD

Composed Index as primary key? Posted by Samir H. @ 7/15/2010 11:26:26 AM
RE: Composed Index as primary key? Posted by Cetin Basoz @ 7/15/2010 12:34:34 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 1:21:52 PM
RE: Composed Index as primary key? Posted by Cetin Basoz @ 7/15/2010 2:19:09 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 2:40:10 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 2:03:14 PM
RE: Composed Index as primary key? Posted by tushar @ 7/15/2010 2:16:13 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 2:38:39 PM
RE: Composed Index as primary key? Posted by tushar @ 7/15/2010 3:44:03 PM
RE: Composed Index as primary key? Posted by Cetin Basoz @ 7/15/2010 2:35:00 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 2:49:40 PM
RE: Composed Index as primary key? Posted by Cetin Basoz @ 7/15/2010 3:45:23 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 4:01:37 PM
RE: Composed Index as primary key? Posted by Mike Yearwood @ 7/15/2010 8:21:47 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/16/2010 4:48:41 AM
RE: Composed Index as primary key? Posted by Mike Yearwood @ 7/16/2010 6:07:24 AM
RE: Composed Index as primary key? Posted by Samir H. @ 7/16/2010 6:16:14 AM
RE: Composed Index as primary key? Posted by Cetin Basoz @ 7/16/2010 1:12:42 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/16/2010 1:23:51 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/16/2010 1:46:54 PM
RE: Composed Index as primary key? Posted by tushar @ 7/15/2010 4:02:29 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/15/2010 4:12:41 PM
RE: Composed Index as primary key? Posted by Anders Altberg @ 7/16/2010 1:20:32 PM
RE: Composed Index as primary key? Posted by Samir H. @ 7/16/2010 1:31:56 PM