Baanboard.com

Go Back   Baanboard.com > Blogs > bhuvaneshwari's blog

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

 
Delete Millions Of Records with Less Time and Performance
By bhuvaneshwari at 28 May 2009 - 06:57

Hi,

We have Millions of Baan records . And now we need to delete all the records.

But it takes very long time to do the same.

Can anyone suggest how to delete the records with less time.

 

Thanks,

Bhuman 

0
No votes yet

by bdittmar on May 29, 2009 - 10:30am
bdittmar's picture
Quote:
Originally Posted by bhuvaneshwari View Post
Hello,

db.clear.table()

--------------------------------------------------------------------------------

Syntax
long db.clear.table( long table_id [, long flag [, long comp_nr]] )
Description
This deletes all data from a specified table. Reference counters are automatically updated.

By default, all deleted records are saved in rollback segments. Consequently, using this function to clear a large table can result in reduced performance and, in some cases, can cause overflow of the internal rollback segments.

Arguments
table_id
The table ID, as returned by db.bind().

flag Use this optional argument to indicate whether the delete operation must be performed as a single transaction or as multiple transactions. The possible values are:

0 WITH.ROLLBACK
The table is cleared in a single transaction. All records are saved in rollback segments. This is the default option.

1 NO.ROLLBACK
The table is cleared in one or more transactions, depending on the number of records in the table. Each transaction is automatically committed after 20 records have been deleted. The number of records deleted in the final transaction can be 20 or less; this depends on how many records remain to be deleted.

When you use this option, transactions are small and records are not saved in rollback segments.

When you use this option, you must place db.clear.table() at the start of the transaction.


comp_nr
This optional argument specifies a company number for the table. The default company is the company of the user.


Return values
0 success
<>0 error


All times are GMT +2. The time now is 14:52.


©2001-2017 - Baanboard.com - Baanforums.com