Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Accessing the items in a DataWindow – PB Docs 126 – PowerBuilder Library

Accessing the items in a DataWindow – PB Docs 126

Accessing the items in a DataWindow

You can access data values in a DataWindow by using methods
or DataWindow data expressions. Both methods allow you to access
data in any buffer and to get original or current values.

The method you use depends on how much data you are accessing
and whether you know the names of the DataWindow columns when the
script is compiled.

For guidelines on deciding which method to
use, see the DataWindow Reference.

Using methods

There are several methods for manipulating data in a DataWindow
control.

These methods obtain the data in a specified row and column
in a specified buffer (Web DataWindow methods have separate methods
for overloaded versions):

  • PowerBuilder

    GetItemDate, GetItemDateTime, GetItemDecimal, GetItemNumber,
    GetItemString, GetItemTime

  • Web ActiveX

    GetItemDate, GetItemNumber, GetItemString

  • Web DataWindow server component

    GetItemDate, GetItemDateByColNum, GetItemDateByColNumEx, GetItemDateEx, GetItemDateTime,
    GetItemDateTimeByColNum, GetItemDateTimeByColNumEx, GetItemDateTimeEx,
    GetItemNumber, GetItemNumberByColNum, GetItemNumberByColNumEx, GetItemNumberEx,
    GetItemStatus, GetItemStatusByColNum, GetItemString, GetItemStringByColNum,
    GetItemStringByColNumEx, GetItemStringEx, GetItemTime, GetItemTimeByColNum, GetItemTimeByColNumEx,
    GetItemTimeEx

This method sets the value of a specified row and column:

  • PowerBuilder
    and Web ActiveX

    SetItem

  • Web DataWindow server component

    SetItemDate, SetItemDateByColNum, SetItemDateTime, SetItemDateTimeByColNum,
    SetItemNumber, SetItemNumberByColNum, SetItemStatus, SetItemStatusByColNum, SetItemString,
    SetItemStringByColNum, SetItemTime, SetItemTimeByColNum

For example, the following statement, using PowerBuilder syntax,
assigns the value from the empname column of the first row to the
variable ls_Name in the Primary buffer:

This PowerBuilder statement sets the value of the empname
column in the first row to the string Waters:

Uses

You call the GetItem methods to obtain the data that has been
accepted into a specific row and column. You can also use them to
check the data in a specific buffer before you update the database.
You must use the method appropriate for the column’s datatype.

For more information about the methods listed
above, see the DataWindow Reference.

Using expressions

DataWindow data expressions refer to single items, columns,
blocks of data, selected data, or the whole DataWindow.

The way you construct data expressions depends on the environment:

  • PowerBuilder

    Use dot notation

  • Web ActiveX

    Data expressions are not supported

Expressions in PowerBuilder

The Object property of the DataWindow control lets you specify
expressions that refer directly to the data of the DataWindow object
in the control. This direct data manipulation allows you to access
small and large amounts of data in a single statement, without calling methods:

The next statement sets the value of the first column in the
first row in the DataWindow to Smith:

For complete instructions on how to construct
DataWindow data expressions, see the DataWindow Reference.


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