Simplicty and flexibility!

Delete records in vs For Table ; delete records .

Started by Henk Spierings
You will need to Sign In to be able to add or comment on the forum!

Delete records in vs For Table ; delete records .

Our Italian guys used “delete records in <Tablename> with bla bla bla”very often.

And since some weeks we have problems with this statement.

It doesn’t work any more in a procedure with the form

Define fields bla bla bla.

Delete records in tablename with xxx=yyy .

For othertablename with aaa=bbb ;

Enter a record in tablename

Copy all from othertablename ;

Additionalfield := qwerty .

Do something more or do something else


So deleting records before entering new ones in.

If we change such a procedure with the statement run procedure pdeletetablename

And create procedure pdeletetablename with the only statement the delete records ; it works.

Does this have to do with a big procedure or something with locking or something else ?

Any idea ?

I searched for “delete record” in dql info and there I got 105 hits, I don’t like when we have to change them.

And it worked in 7.2, never had problems.

Did something change there ?

Written by Henk Spierings 28/06/19 at 11:53:31

Re:Delete records in vs For Table

Hi Henk.

deleting the records in the same table as you repopulate the table has been finicky since DFD so not sure anything has changed.

Delete records in vs for Table delete records has also been finicky so most likely you have just ended up with getting into corner cases.

This is multiuser problems and we have started (but not completed as this is not crucial for release of DE9 but very desirable in the longer perspective. We can increase speeds and reliability many 10s of times by revising the model that has been there since DFD) a big revision of this in DE9.

“And it worked in 7.2, never had problems.”
This has been the same and as “problematic” from long before 7.2 and it is related to single user/multi-user. The only reason this can have worked better in 7.2 is if you run it on a standalone computer as Shared Local Database is switched off by default in 7.2 and on by default in 8.x

To be honest, I could not provoke the error in either 7.2 (how can anyone use 7.2 my neck here cringe when I have to do anything in it, and they are starting to do the same in 8.5) or 8.5

But I know what problem you speak of and the best way to get around it is not to delete and create in the same DQL.

Alternatively you use

FOR table with xxx=yyy ;
delete records.

it is slower but then it step through each record and delete it.

Delete records in Table with xxx=yyy . is more efficient but has the problem that it can fail and then it fail totially.


Delete records in table . will not work if several people is using the table as this truncate the table and that will only be allowed on standalone.

Written by DataEase 28/06/19 at 12:21:54 Dataease [{8}]FIVE