1. Faisal Hayat
  2. PowerBuilder
  3. Tuesday, 8 January 2019 14:15 PM UTC

Hi Guys,

I have datawindow which fetches the data from a single table and the table is a TEMP table. In order to add a new column to datawindow I use edit source and adds a column is select statement and add a column as well. The new column is not required in design mode. 

 

In Select

OLD

SELECT col1, col2 from tempt1;

New

Select col1, newcol, col2 from tempt1;

 

In Columns

Old

 column=(type=date updatewhereclause=yes name=col1 dbname="col1" )

 column=(type=date updatewhereclause=yes name=col2dbname="col2" )

New

 column=(type=date updatewhereclause=yes name=col1 dbname="col1" )

 column=(type=date updatewhereclause=yes name=newcol dbname="newcol" )

 column=(type=date updatewhereclause=yes name=col2dbname="col2" )

 

col1 and col2 are also part of design.

 

Now I have question that adding a new column between existing columns  using edit source of datawindow will have any negative impact on datawindow design, column indexes or anything? The reason of asking question is that it has some issues in older versions of PB and whether it has been sorted in PB2017 or not?

 

 

Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 8 January 2019 15:46 PM UTC
  2. PowerBuilder
  3. # Permalink

The columns that are visible are referenced by an ID number which is the sequence of the column in the result set. Since you added a new column in the middle, the columns after that will have a different ID number. Here is an example from one of mine:

column(band=detail id=3 alignment="0" tabsequence=10 border="5" color="33554432" x="78" y="4" ...

You'll have to renumber the ID of the column entries, otherwise they will show the wrong data.

 

 

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Tuesday, 8 January 2019 14:33 PM UTC
  2. PowerBuilder
  3. # 1

Hi Faisal,

 

if you want to insert a new column in edit mode you have to change the "id" of the column objects. (Also if you want delete a column or change the order of columns.)

column(... id=1 ...)

 

The id is the (not explicit specified) number of the column in your "table" specification.

In your example: OLD: col1 = 1, col2 = 2  NEW: col1 = 1, newcol = 2, col2 = 3

 

Regards,

René

 

 

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.