1. Bjarne Anker
  2. PowerBuilder
  3. Tuesday, 22 May 2018 22:54 PM UTC

Hi.

 

We have to expand a column in the database from varchar(50) to varchar(100).

That column is referenced in a LOT of datawindows.

 

Is there a way to update all of the datawindows at once so that the datatype is set to char(100) in all of them?

Or do I have to manually go through all of them?

 

Best regards,

 

Bjarne Anker

Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 23 May 2018 01:31 AM UTC
  2. PowerBuilder
  3. # Permalink

PBSearch does have a Global Search and Replace feature that even will do source control check-out.

Here is a sample DataWindow column definition:

column=(type=char(50) updatewhereclause=no name=mycolumn dbname="mytable.mycolumn" )

You would have to search on the bold part above or possibly the entire line to ensure you are finding the correct column.

Comment
  1. Bjarne Anker
  2. Wednesday, 23 May 2018 08:47 AM UTC
Hi Roland.



 



Of course I have PBsearch. Great tool. :)



I will try the global search for sure.



 



regards,



 



Bjarne

  1. Helpful
There are no comments made yet.
Arthur Hefti Accepted Answer Pending Moderation
  1. Wednesday, 23 May 2018 03:28 AM UTC
  2. PowerBuilder
  3. # 1

If you work with PB 2017 R2 and native source control (e.g. git) you can use any tool to search/replace the source files in the file system and do a refresh from the system tree.

Regards
Arthur

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 23 May 2018 13:28 PM UTC
Hi Arthur;



  I use native source control for these type of global changes quite often.



Works great!



Regards ... Chris

  1. Helpful
There are no comments made yet.
Kim Berghall Accepted Answer Pending Moderation
  1. Tuesday, 22 May 2018 23:44 PM UTC
  2. PowerBuilder
  3. # 2

When you make table schema changes it requires the corresponding datawindows to be updated. Typically we open the dw, make a a "no change" change on the datasource sql side like typing in a space and deleting it (we always convert all data sources to SQL Statements) then it updates the length in the dw. You may still need to widen the field in itself as well as modify the max number of characters allowed (if not using the default 0). The moral of the story, minimize schema changes.

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Tuesday, 22 May 2018 23:25 PM UTC
  2. PowerBuilder
  3. # 3

Ugh.

Option 1:
The best way I've found to do this is to, such as it is, it to hit each DW that contains the column to be changed one at a time.
Use EDIT SOURCE on the datawindow, FIND the column, then manually change the "(50)" to "(100)".

Yeah, that really sucks. But it's safe and it's accurate.

Option 2:
Purchase a copy of PBSearch from TopWiz:  http://www.topwizprogramming.com/pbsearch.html
It's a great tool and very much worth the cost.

At the very least, you can search the entire application in one go with this tool, then use the steps in option 1 with the REPLACE TEXT option:


There may be a way do mass changes, but I don't know it. Email Roland and ask him. Roland@topwizprogramming.com


Good Luck,

Olan

 

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.