Caner.B
24th October 2001, 13:43
Hi,

is there a way to delete all the rows in a table by code.
I need something that does the same thing like the 'Remove Rows' property used in General Table Maintenance.

Thanks

Caner

MariaC
24th October 2001, 15:21
I'm not sure if you can use a drop table cmmand in a baan script, but I would do a select statement that reads all the records and in the selectdo do a db.delete command

eg.

select tiitm001.*
from titim001
selectdo
db.delete(ttiitm001,db.retry)
endselect

you can commit the transaction after each delete (eg. every 50th record)or else do the commit after the endselect, depending on the number of records in the table.

isimeon
24th October 2001, 18:38
You can use db.clear.table(...). Be careful, read the help.