dbAlias
property (DataWindow object)
Description
The name of the database column but with the table alias in place
of the table name, if any. This value can be used to construct the
update DataWindow syntax dynamically when an alias name is used for a
table.
Applies to
Column controls
Syntax
PowerBuilder dot notation:
|
1 |
dw_control.Object.columnname.dbAlias |
Describe and Modify argument:
|
1 |
"columnname.dbAlias { = ' dbcolumnname ' }" |
|
Parameter |
Description |
|---|---|
|
columnname |
The name of the column for which you want the name |
|
dbcolumnname |
The name of the database column associated with |
Usage
DbAlias is the name of the database column in the format
tablealiasname.columnname. The value of dbAlias does not include the
quotes that can be part of the SQL syntax. This property can be used to
construct update DataWindow syntax dynamically when an alias is used for
a column name.
In the painter
You can specify an alias for a table in the SQL Select painter if
you convert the SQL statement for a DataWindow object to syntax. Select
Design>Data Source to open the SQL Select painter, then select
Design>Convert to Syntax. In the text window that displays, add the
alias name to the FROM clause using the syntax:
|
1 |
FROM tablename tablealiasname |
Examples
Suppose a DataWindow object has the following SQL Select syntax,
with the alias “emp” for the table “employee”:
|
1 2 3 4 5 6 |
SELECT "emp"."emp_id", "emp"."emp_fname", "emp"."emp_lname" "emp"."dept_id" "emp"."salary" FROM "employee" "emp" WHERE ( "emp"."salary" > 50000 ) |
Then the following statements would return the string
“employee.emp_id” in ls_name and the string “emp.emp_id” in
ls_alias:
|
1 2 3 4 5 6 |
string ls_alias, ls_name ls_name = dw1.Object.emp_id.dbName ls_name = dw1.Describe("emp_id.dbName") ls_alias = dw1.Object.emp_id.dbAlias ls_alias = dw1.Describe("emp_id.dbAlias") |
See also