Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Names in 'Column Specification' sometimes include table

Status
Not open for further replies.

Statey603

Programmer
Nov 10, 2009
196
US
We ran into something peculiar this morning and I was wondering if anyone can shed some light on this.

We have 2 data window object that have the same data fileds and where clause. One is a grid and the other is a report associated with the grid. The SELECT statements for both objects are exactly the same.

We ran into problems with a filter producing different results. It turned out that in one of the datawindows, the table name was included in the Column Specification Name values (tablename_fieldname). The other datawindow only had the fieldname. We were unable to modify the Column Requirement Name values using the PB Painter environment and ended up using Edit Source to remove the tablename prefix in one of the datawindows so that all of the fields matched. Once we did this, the filter worked properly on the report.

The big question is where do the Column Specification Name values soriginally come from? The select for the report dw object was copied from the grid object when the report was created so one might assume the column names would be the same. I am asking in case there might be a way to avoid this confusion in the future.

PowerBuilder 11.0

Thanks,
Bill
 
You have to pay attention when the datawindow is being created. It's been my experience that this happens when your SQL involves multiple tables. One way to avoid this is to give the columns in the SQL result set an alias name. Something like;

Code:
SELECT partcode = partMast.partCode 
       , partdesc = partMast.partDesc
       , orderqty = orders.orderQty
       ...
FROM partMast
LEFT JOIN orders on partMast.partCode = orders.partCode
....

Matt





"Nature forges everything on the anvil of time"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top