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

Syntax for one or all data items in a named column – PB Docs 2018 – PowerBuilder Library

Syntax for one or all data items in a named column – PB Docs 2018

Syntax for one or all data items
in a named column

Description

A DataWindow data expression can access a single item in a column
or computed field when you specify the control name and a row number. It
accesses all the data in the column when you omit the row number.

Syntax

Parameter

Description

dwcontrol

The name of the DataWindow control or child
DataWindow in which you want to get or set data.

columnname

The name of a column or computed field in the
DataWindow object in dwcontrol. If the column or computed field
does not exist at runtime, an execution error
occurs.

buffer 

(optional)

The name of the buffer from which you want to get
or set data. Values are:

  • Primary — (Default) The data in the primary buffer
    (the data that has not been deleted or filtered
    out).

  • Delete — The data in the delete buffer (data
    deleted from the DataWindow control).

  • Filter — The data in the filter buffer (data that
    was filtered out).

datasource 

(optional)

The source of the data. Values
are:

  • Current — (Default) The current values in the
    DataWindow control.

  • Original — The values that were initially retrieved
    from the database. For a computed field, you must specify
    Original because computed fields cannot be changed and do
    not have current values.

rownum 

(optional)

The row number of the desired item. The row number
must be enclosed in brackets.

To access all the data
in the column, omit rownum.

When buffer or
datasource is not optional

When rownum is omitted,
you must specify at least one of the other elements in the
expression: either buffer or datasource.

Return value

The expression has a datatype of Any. The expression returns a
single value (for a specific row number) or an array of values (when
rownum is omitted). Each value has a datatype of columnname.

Usage

Is the expression a DWObject or
data?

When you want to access all the data in the column, remember to
specify at least one of the other optional parameters. Otherwise, the
expression you specify refers to the column control, not its data. This
expression refers to the DWObject empname, not the data in the
column:

In contrast, these expressions all refer to data in the empname
column:

Row numbers for computed
fields

When you refer to a control in a band other than the detail band
(usually a computed field) you still specify a row number. For the
header, footer, or summary, specify a row number of 1. For the group
header or trailer, specify the group number:

If you specify nothing after the computed field name, you refer to
the computed field DWObject, not the data. For a computed field that
occurs more than once, you can get all values by specifying buffer or
datasource instead of rownum, just as for columns.

When the expression is an
array

When the expression returns an array (because there is no row
number), you must assign the result to an array, even if you know there
is only one row in the result.

This expression returns an array, even if there is only one row in
the DataWindow control:

This expression returns a single value:

Examples

Because the default setting is current values in the primary
buffer, the following expressions are equivalent — both get the value
in row 1 for the emp_name column:

This statement sets the emp_name value in row 1 to Wilson:

This statement gets values for all the emp_name values that have
been retrieved and assigns them to an array of strings:

This statement gets current values of emp_name from all rows in
the filter buffer:

This statement gets original values of emp_name from all rows in
the filter buffer:

This statement gets the current value of emp_name from row 14 in
the delete buffer:

This statement gets the original value of emp_name from row 14 in
the delete buffer:

This statement gets all the values of the computed field
review_date:


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