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: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: Allow user to delete?
Thread ID: 269040 Message ID: 269085 # Views: 50 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Friday, July 16, 2010 11:07:02 AM         
   


Hello Jun
What does you code demonstrate, besides showing that Set Autoinc Off hides error messages?
I got the same results with autoinc ON and OFF. And correct results, it seems to me.
Can you explain a little bit more?

SET DELETED ON 
Set Autoincerror ON  
Create Cursor teacher (TPK I Autoinc, TName c(20))
Insert Into teacher (TName) Values ("Samir")
Insert Into teacher (TName) Values ("Jun")

Create Cursor students (SPK I Autoinc, SName c(20), TFK I)
Insert Into students  (SName,TFK ) Values ("Stud1",1)
Insert Into students  (SName,TFK ) Values ("Stud2",1)
Insert Into students  (SName,TFK ) Values ("Stud3",2)


Delete For TPK = 1 In teacher
SELECT teacher
BROWSE 
Select t1.SName, t2.TName From students t1;
    LEFT Outer Join teacher t2;
    ON t1.TFK == t2.TPK
******************************************
SET DELETED ON 
Set Autoincerror OFF  
Create Cursor teacher (TPK I Autoinc, TName c(20))
Insert Into teacher Values (0,"Samir")
Insert Into teacher Values (0,"Jun")

Create Cursor students (SPK I Autoinc, SName c(20), TFK I)
Insert Into students Values (0,"Stud1",1)
Insert Into students Values (0,"Stud2",1)
Insert Into students Values (0,"Stud3",2)


Delete For TPK = 1 In teacher
SELECT teacher
BROWSE 
Select t1.SName, t2.TName From students t1;
    LEFT Outer Join teacher t2;
    ON t1.TFK == t2.TPK


> >
> > Hi Eric
> > I'm relatively new in relational-db and want to make sure I understood you well. You mean:
> > - Never delete a master record (employee, product etc...)
> > - Mark it as "gone" with datetime.
> > If this is what you meant, is this a common way to do things in database apps? It doesn't matter carrying old records, may be for years?
> >
> >
> > Regards
> > Samir
>
>
>
> Samir, take a look at this:
>
>
> SET DELETED ON 
> Set Autoincerror Off
> Create Cursor teacher (TPK I Autoinc, TName c(20))
> Insert Into teacher Values (0,"Samir")
> Insert Into teacher Values (0,"Jun")
> 
> Create Cursor students (SPK I Autoinc, SName c(20), TFK I)
> Insert Into students Values (0,"Stud1",1)
> Insert Into students Values (0,"Stud2",1)
> Insert Into students Values (0,"Stud3",2)
> 
> Delete For TPK = 1 In teacher
> Select t1.SName, t2.TName From students t1;
>     LEFT Outer Join teacher t2;
>     ON t1.TFK == t2.TPK

>
>
>
> http://www.junblogs.com/
> http://weblogs.foxite.com/sandstorm36/default.aspx
> http://www.coderisland.com/forum/viewforum.php?f=10



Regards
Samir

ENTIRE THREAD

Allow user to delete? Posted by Samir H. @ 7/16/2010 8:15:15 AM
RE: Allow user to delete? Posted by Eric den Doop @ 7/16/2010 8:44:09 AM
RE: Allow user to delete? Posted by Samir H. @ 7/16/2010 9:02:51 AM
RE: Allow user to delete? Posted by tushar @ 7/16/2010 9:07:21 AM
RE: Allow user to delete? Posted by Samir H. @ 7/16/2010 9:09:56 AM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/16/2010 3:31:14 PM
RE: Allow user to delete? Posted by Samir H. @ 7/16/2010 3:40:28 PM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/16/2010 7:08:49 PM
RE: Allow user to delete? Posted by Samir H. @ 7/16/2010 7:23:49 PM
RE: Allow user to delete? Posted by Samir H. @ 7/28/2010 7:50:51 PM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/28/2010 8:45:57 PM
RE: Allow user to delete? Posted by tushar @ 7/29/2010 6:09:49 AM
RE: Allow user to delete? Posted by Samir H. @ 7/29/2010 6:16:56 AM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/29/2010 6:37:48 AM
RE: Allow user to delete? Posted by Samir H. @ 7/29/2010 6:44:02 AM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/29/2010 6:47:55 AM
RE: Allow user to delete? Posted by Samir H. @ 7/29/2010 6:51:16 AM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/29/2010 6:53:54 AM
RE: Allow user to delete? Posted by Samir H. @ 7/29/2010 7:11:42 AM
RE: Allow user to delete? Posted by Jun Tangunan @ 7/16/2010 9:24:37 AM
RE: Allow user to delete? Posted by Samir H. @ 7/16/2010 11:07:02 AM
RE: Allow user to delete? Posted by Jun Tangunan @ 7/16/2010 11:36:30 AM
RE: Allow user to delete? Posted by Samir H. @ 7/16/2010 11:45:26 AM
RE: Allow user to delete? Posted by Jun Tangunan @ 7/16/2010 11:57:03 AM
RE: Allow user to delete? Posted by Samir H. @ 7/16/2010 12:06:24 PM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/17/2010 12:06:21 AM
RE: Allow user to delete? Posted by Samir H. @ 7/17/2010 5:41:37 AM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/16/2010 3:24:20 PM
RE: Allow user to delete? Posted by Samir H. @ 7/16/2010 3:35:58 PM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/16/2010 6:58:12 PM
RE: Allow user to delete? Posted by Samir H. @ 7/16/2010 3:44:11 PM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/16/2010 11:13:37 PM
RE: Allow user to delete? Posted by Binod Binani @ 7/17/2010 7:51:53 AM
RE: Allow user to delete? Posted by Samir H. @ 7/21/2010 6:17:52 AM
RE: Allow user to delete? Posted by Mike Yearwood @ 7/21/2010 3:30:07 PM
RE: Allow user to delete? Posted by Samir H. @ 7/21/2010 4:14:28 PM
RE: Allow user to delete? Posted by Samir H. @ 8/2/2010 7:38:23 AM
RE: Allow user to delete? Posted by Mike Yearwood @ 8/2/2010 3:42:57 PM
RE: Allow user to delete? Posted by Samir H. @ 8/2/2010 3:58:20 PM
RE: Allow user to delete? Posted by Mike Yearwood @ 8/2/2010 4:00:51 PM
RE: Allow user to delete? Posted by Samir H. @ 8/2/2010 4:10:57 PM
RE: Allow user to delete? Posted by Mike Yearwood @ 8/2/2010 4:27:01 PM
RE: Allow user to delete? Posted by Samir H. @ 8/2/2010 5:45:12 PM
RE: Allow user to delete? Posted by Mike Yearwood @ 8/2/2010 8:00:48 PM