PowerBuilder: Defining a primary key for data windows

I am creating some events in a base object (class) in PowerBuilder, and the offspring of this base data window need to know what the primary key of this table (or row) is. How do you define a primary key in code?

+3
source share
3 answers

You can iterate over the list of columns in the data window and check the Key property using descriptive or dot notation:

<DW Control Name>.Describe("<Columnname>.Key")
or
<DW Control Name>.Object.<Columnname>.Key

This allows you to find out whether a column is included in the selected list that you see in the data wizard, in the menu item Rows-> Update Properties-> Unique Columns (s):

Here are the docs for this property:

http://infocenter.sybase.com/help/topic/com.sybase.dc37783_1150/html/dwref/CAIBHFGF.htm

+3

, , , , , . .

, Powerscript, "columnname.key", .

, , datawindow; , .

- , .

+1

, , ? Powerbuilder 2.0, , .

0

Source: https://habr.com/ru/post/1721515/


All Articles