dbAlias DataWindow object property
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.
Controls
Column controls
Syntax
PowerBuilder dot notation:
1 |
<span>dw_control</span>.Object.<span>columnname.</span>dbAlias |
Describe and Modify argument:
1 |
"<span>columnname.</span>dbAlias { = '<span> dbcolumnname</span> ' }" |
Parameter |
Description |
---|---|
columnname |
The name of the column for which you |
dbcolumnname |
The name of the database column associated |
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 <span>tablename</span> <span>tablealiasname</span> |
Examples
Suppose a DataWindow object has the following SQL Select syntax, with the alias “emp” for
the table “employee”:
1 |
SELECT "emp"."emp_id",<br>       "emp"."emp_fname",<br>       "emp"."emp_lname"<br>       "emp"."dept_id"<br>       "emp"."salary"<br>FROM "employee" "emp" <br>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 |
string strAlias, strName<br>strName = dw1.Object.emp_id.dbName |
1 |
strAlias = dw1.Object.emp_id.dbAlias |
1 |
strName = dw1.Describe("emp_id.dbName") |
1 |
strName = dw1.Describe("emp_id.dbAlias") |