1. Brady Schmidt
  2. PowerBuilder
  3. Tuesday, 17 May 2022 22:12 PM UTC

Hello,

Recently, when I create a new data window, or modify the select of an existing data window, the name of the column in the datawindow will be a combination of the table and column name. I am using Powerbuilder 2017 R3 build 1915.

For example if my select is:

select owner_name
from all_owners

the column shows up in the data window as all_owners_owner_name. Is there a workaround or setting I can adjust so that the table name is not included in my column names when modifying datawindows?


Thanks!

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 17 May 2022 23:15 PM UTC
  2. PowerBuilder
  3. # 1

Hi Brady;

  If the DB user ID you use to log into your DBMS has the Database Owner "select" privileged, then the DW Painter will not use the Table Name in its generated SQL. The only exception to this rule is when you are performing a Table Join.

Regards ... Chris

Comment
There are no comments made yet.
Benjamin Gaesslein Accepted Answer Pending Moderation
  1. Wednesday, 18 May 2022 11:43 AM UTC
  2. PowerBuilder
  3. # 2

Hello Brady,

a workaround would be manually editing the column names either via "edit source" or directly in the painter. If you do the former, note that the name will appear multiple times in the source code.

Comment
There are no comments made yet.
Ronnie Po Accepted Answer Pending Moderation
  1. Wednesday, 18 May 2022 17:04 PM UTC
  2. PowerBuilder
  3. # 3

Here is a workaround syntax that I use for SQL Anywhere and may work with other DBMSs:

 SELECT <alias> = <column name>, ...

The column control in the DW will be named <alias>.

From your question, the example would be:

  SELECT owner_name = owner_name

  FROM all_owners

...

NOTE that the standard syntax "SELECT <column> AS <alias>" does NOT work.

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Thursday, 19 May 2022 14:53 PM UTC
  2. PowerBuilder
  3. # 4

The default behavior of PowerBuilder is that is you only have ONE table selected when creating your datawindow, the columns will NOT have pre-pended table_names and the column names will be <column_name>.

If you specify two or more tables when creating your datawindow, then the columns WILL have table_name prepended to the column name, such that the column name = <table name>_<column_name>. This sllows the code to know from which table each column was derived.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.