Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Merinissa Galapon
  Where is Merinissa Galapon?
 Licab, Nueva Ecija
 Philippines
 Merinissa Galapon
 Tags
Subject: RE: Delete in Update Table
Thread ID: 199752 Message ID: 199755 # Views: 72 # Ratings: 1
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, October 23, 2008 4:35:24 AM         
   


> To everyone,
>
> I wonder why my statement 'Update' below does not affect the OrigTable? If I make some changes to the data in the CurTable and use 'Update' command to make changes to OrigTable, it works. But If I delete a record from the CurTable and use 'Update' command to update the contents of the OrigTable, it won't work.
>
> Why is that? Thank you very much in advance.
>
>
> Create Table OrigTable (acctno c(10), custname c(30))
> Insert Into OrigTable Values ('0000000001','MERINISSA')
> Insert Into OrigTable Values ('0000000002','MERCEDITA')
> 
> Select * From OrigTable Into Cursor CurTable ReadWrite
> 
> Delete For CurTable.acctno = '0000000002'
> 
> Update OrigTable Set OrigTable.custname = CurTable.custname Where ;
> Alltrim(OrigTable.acctno) = Alltrim(CurTable.acctno)
> 

>
> Merinissa Galapon
> Discontent is the first step in progress.

The update SQL does just that, it updates the contents of a table .
If you want to affect the OrigTable in the way that you want to delete the same record as you did in the cursor you need the DELETE FROM SQL statement.



Boudewijn LutgeĀ®ink
http://www.vfpdevelopers-online.com
The truth will set you free, Ken knew the truth!

COMPLETE THREAD

Delete in Update Table Posted by Merinissa Galapon @ 10/23/2008 3:52:43 AM
RE: Delete in Update Table Posted by Boudewijn Lutgerink @ 10/23/2008 4:35:24 AM
RE: Delete in Update Table Posted by Merinissa Galapon @ 10/23/2008 4:52:49 AM
RE: Delete in Update Table Posted by Arjun Bagojikop @ 10/23/2008 4:59:57 AM
RE: Delete in Update Table Posted by Merinissa Galapon @ 10/24/2008 4:32:06 AM
RE: Delete in Update Table Posted by Anders Altberg @ 10/24/2008 10:41:57 AM
RE: Delete in Update Table Posted by Merinissa Galapon @ 10/25/2008 3:38:18 AM
RE: Delete in Update Table Posted by Anders Altberg @ 10/23/2008 10:07:19 AM
RE: Delete in Update Table Posted by Merinissa Galapon @ 10/24/2008 4:21:40 AM
RE: Delete in Update Table Posted by Anders Altberg @ 10/24/2008 10:32:58 AM
RE: Delete in Update Table Posted by Merinissa Galapon @ 10/25/2008 3:56:26 AM
RE: Delete in Update Table Posted by Anders Altberg @ 10/25/2008 9:12:16 AM
RE: Delete in Update Table Posted by Merinissa Galapon @ 10/25/2008 9:51:49 AM
RE: Delete in Update Table Posted by Anders Altberg @ 10/25/2008 3:48:48 PM
RE: Delete in Update Table Posted by Merinissa Galapon @ 10/27/2008 2:00:27 AM
RE: Delete in Update Table Posted by Anders Altberg @ 10/23/2008 12:25:46 PM
RE: Delete in Update Table Posted by Merinissa Galapon @ 10/24/2008 4:18:08 AM
RE: Delete in Update Table Posted by Cetin Basoz @ 10/24/2008 12:03:56 PM
RE: Delete in Update Table Posted by Anders Altberg @ 10/24/2008 1:09:50 PM
RE: Delete in Update Table Posted by Cetin Basoz @ 10/24/2008 4:06:00 PM
RE: Delete in Update Table Posted by Anders Altberg @ 10/24/2008 6:04:43 PM
RE: Delete in Update Table Posted by Cetin Basoz @ 10/24/2008 6:18:46 PM
RE: Delete in Update Table Posted by Anders Altberg @ 10/24/2008 10:16:39 PM
RE: Delete in Update Table Posted by Merinissa Galapon @ 10/25/2008 4:25:12 AM
RE: Delete in Update Table Posted by Anders Altberg @ 10/25/2008 11:21:05 AM
RE: Delete in Update Table Posted by Merinissa Galapon @ 10/27/2008 2:13:43 AM