DeletedCount – PB Docs 150

DeletedCount method (DataWindows)

Description

Reports the number of rows that have been marked for deletion
in the database.

Controls

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore
object

Web

Client control, server component

Web ActiveX

DataWindow control, DataWindowChild object

Syntax

[PowerBuilder and Web DataWindow server component]

[Web DataWindow client control and Web ActiveX]

Argument

Description

dwcontrol

A reference to a DataWindow control,
DataStore, or child DataWindow

Return Values

Returns the number of rows that have been deleted from dwcontrol but
not updated in the associated database table.

Returns 0 if no rows have been deleted or if all the deleted
rows have been updated in the database table. DeletedCount returns –1
if it fails.

If any argument’s value is null, in PowerBuilder
and JavaScript the method returns null.

Usage

An updatable DataWindow control or DataStore has several buffers.
The primary buffer stores the rows currently being displayed. The
delete buffer stores rows that the application has marked for deletion
by calling the DeleteRow method. These rows are
saved until the database is updated. You can use DeletedCount to
find out if there are any rows in the delete buffer.

If a DataWindow is not updatable, rows that are deleted are
discarded—they are not stored in the delete buffer. Therefore, DeletedCount returns
0 for a nonupdatable DataWindow unless a method, such as RowsCopy or RowsMove,
has been used to populate the delete buffer.

Examples

Assuming two rows in dw_employee have been
deleted but have not been updated in the associated database table,
these statements set ll_Del to 2:

This example tests whether there are rows in the
delete buffer, and if so, updates the database table associated
with dw_employee:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x