ReselectRow

Description

Accesses the database to retrieve values for all columns that can be updated and refreshes all timestamp columns in a row in a DataWindow control or DataStore. The values from the database are redisplayed in the row.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore object


Syntax

PowerBuilder

integer dwcontrol.ReselectRow ( long row ) 

Argument

Description

dwcontrol

A reference to the DataWindow control, DataStore, or child DataWindow in which you want to reselect a row

row

A value identifying the row to reselect


Return value

Returns 1 if it is successful and -1 if the row cannot be reselected (for example, the DataWindow object cannot be updated or the row was deleted by another user).

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

Usage

ReselectRow is supported for SQLSelect DataWindows. Use ReselectRow to discard values the user changed and replace them with values from the database after an update fails (due to a concurrent access error, for example).

About timestamp support

Timestamp support is not available in all DBMSs. For information on timestamp columns, see the documentation for your DBMS.

Note If you are using ShareData and then use ReselectRow on the primary DataWindow, the secondary DataWindow resets back to row 1, column 1.

Examples

This statement reselects row 5 in the DataWindow control dw_emp:

dw_emp.ReselectRow(5)

This statement reselects the clicked row if the update is not successful:

IF dw_emp.Update( ) < 0 THEN
      dw_emp.ReselectRow(dw_emp.GetClickedRow())
END IF

See also

GetClickedRow

SelectRow

Update