Share via


BatchUpdateCount Property

Specifies the number of update statements sent to the remote data source for buffered tables. When working with this property for regular cursors, use the CURSORSETPROP() and CURSORGETPROP() functions. Read/write.

Adjusting BatchUpdateCount can increase automatic updating performance dramatically.

Note

Setting BatchUpdateCount for CursorAdapter objects overrides the property setting of a cursor when attached to a CursorAdapter object. That is, changing the settings on the cursor using CURSORSETPROP() has no effect.

CursorAdapter.BatchUpdateCount [ = nValue]

Return Value

  • nValue
    Numeric data type. The nValue parameter has a default value of 1.

    Note

    When you are updating data, using Table Buffering, and updating the table or tables in the data source from multiple clients, avoid setting BatchUpdateCount to a value greater than 1. In these scenarios, TABLEUPDATE( ) always returns True (.T.). You can safely set BatchUpdateCount to a value greater than 1 for INSERT, UPDATE, and DELETE operations when lForce in TABLEUPDATE( ) is set to True (.T.).

Remarks

Applies To: CursorAdapter Class

BatchUpdateCount applies to CursorAdapter objects only when the data source type for the SQL INSERT, UPDATE, and DELETE commands is one of the following:

  • "ODBC"

    Additionally, the same connection handle must be used as the data source for the SQL INSERT, UPDATE, and DELETE commands.

    Note

    The data source and data source type might be inherited from the DataSource and DataSourceType properties of either the CursorAdapter or DataEnvironment object.

  • "ADO"

    The same ADODB Command object must be used as the data source for the SQL INSERT, UPDATE, and DELETE commands. It is recommended that you set the InsertCmdDataSource, InsertCmdDataSourceType, UpdateCmdDataSource, UpdateCmdDataSourceType, DeleteCmdDataSource, and DeleteCmdDataSourceType properties explicitly because inheritance does not work in this scenario.

  • "XML"

    It is recommended that you set the InsertCmdDataSource, InsertCmdDataSourceType, UpdateCmdDataSource, UpdateCmdDataSourceType, DeleteCmdDataSource, and DeleteCmdDataSourceType properties explicitly because inheritance does not work in this scenario.

If BatchUpdateCount is greater than 1, Visual FoxPro updates the batch by executing the UpdateCmd property once per batch.

Note

If batch updating is used, the BeforeInsert, AfterInsert, BeforeUpdate, AfterUpdate, BeforeDelete, and AfterDelete events do not fire. If an update fails for a batch, Visual FoxPro attempts to send a separate update for each row in the batch; however, the events still do not fire.

See Also

Reference

CursorAdapter Object Properties, Methods, and Events
CURSORGETPROP( ) Function
CURSORSETPROP( ) Function
INSERT - SQL Command
UPDATE - SQL Command
DELETE - SQL Command
DataSource Property (Visual FoxPro)
DataSourceType Property
InsertCmdDataSource Property
InsertCmdDataSourceType Property
UpdateCmdDataSource Property
UpdateCmdDataSourceType Property
DeleteCmdDataSource Property
DeleteCmdDataSourceType Property
UpdateCmd Property
BeforeInsert Event
AfterInsert Event
BeforeUpdate Event
AfterUpdate Event
BeforeDelete Event
AfterDelete Event

Other Resources

Properties (Visual FoxPro)