On Tuesday 25 August 2009 01:57:09 pm Ed Leafe wrote:
> On Aug 25, 2009, at 12:06 PM, <[email protected]>
>
> <[email protected]> wrote:
> > I have a dataset that i want to remove records from.
> > I issued...
> >
> > myds.execute('delete from dataset where id=whatever")
> >
> > I then ran
> >
> > myds.execute('select * from dataset")
> >
> > and the values were gone, however the values still show up when I
> > issue
> >
> > myds
> >
> > How do I re-synch?
>
>       You cannot execute an SQL delete statement against a dataset and have
> it propagate back to the database. If you want to just get the
> resulting dataset, you can run:
>
> newds = myds.execute(...)
>
> ... and newds will contain the result.
>
>       Maybe if you explain a bit more about what you're trying to
> accomplish, I might be able to suggest a better solution.
>
> -- Ed Leafe

First the fix.
reportDS=dDataSet(reportDS.execute('select * from dataset'))

The issue appeared when a special requirement for the reports came up.  Larry 
wanted to retrieve data then delete a few of the records after processing and 
that left a number of records that could be batched for a second process.  
The criteria for the retrieved data was the same for both processes (so why 
make two calls).  So he wanted to work with only one table.  It sounds very 
much like a VFP way of thinking where all that was needed was a scan and 
process.  

It works and very well too.

Johnf




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to