1. Christopher Craft
  2. PowerBuilder
  3. Wednesday, 27 March 2019 22:21 PM UTC

Running PB 2017 R3

I am hoping to find a way to easily manage a window that uses SharaData with multiple DW's. I have a master DW which has every column selected from the table that can be updated. I then create other DW's from this master and only paint the columns I need for that particular view. In the picture below I have just the PO columns painted but you can see there are 10 other DW's that will get swapped in. This works fine until I have a new column to add.  I add it to the master and then I have to go to every DW and add the same column so the ShareData will work again which is a pain.

What I would like to do is be able to create the specific DW's (ie. Purchase Orders) with just the columns I need and then during runtime somehow refresh the column specs from the master DW so the ShareData will work (all the column names will be the same). I thought I could use SetSQLSelect but that does not work.  Does anyone have a genius idea to do this or some other great way to make this work nicely without the maintenance headache?

Thanks - Chris Craft

 

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 28 March 2019 01:08 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Chris;

So, if I understand you correctly, you're asking for a way to somehow automate maybe 30-60 minutes of maintenance effort it should take to manually add the same new column to ten DataWindows? IMO, this doesn't seem to be worth the effort it would likely take to code the desired feature, unless you're spending many hours each month doing this kind of maintenance.

Maybe somebody has already developed a solution and is willing and able to share it.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 28 March 2019 01:26 AM UTC
  2. PowerBuilder
  3. # 1

Hi Cheis;

  For the ShareData() to work, all the DWO's must have the same number of columns, same data types, and the columns in the same order. The only way the "primary" DW can ShareData() to secondary DWO's is to use PB's Dynamic DW feature where you pass the SQL statement to build the DW Source "on the fly". However, this does nothing to control the formatting of the secondary DWO's (without a "ton" of coding).

     Offhand, I cannot think of a viable way to dynamically ShareData() while changing columns "on the fly". It's a "Kool" idea though. No problem to do this in hidden DataStore's but not (IMHO) for visible DWO's in DW Controls where control of the GUI is also required.

Regards ... Chris

Comment
There are no comments made yet.
Brad Mettee Accepted Answer Pending Moderation
  1. Thursday, 28 March 2019 13:21 PM UTC
  2. PowerBuilder
  3. # 2

We have a setup window with 8 tabs of shared data. Although having to hit each DW when we add a field to any of them is a pain, it's never been trouble enough (for 20+ years) that I've actually coded up a automated solution for it.

You would need to export each datawindow object to string, pull the table object from the master DW, and replace it in each shared object, then save the object back out to the pbl. This will give you the select & column definitions, but not add the GUI field to the datawindow itself.

It's pretty easy to modify the master DW in GUI mode, add the column to the select, delete the GUI field if you're not using it on that DW, and save the DW. Then open the master datawindow in source mode, copy the table object to clipboard, then open each shared object in source mode and replace the table object. Since you don't need the GUI field in all versions, you'll only need to edit source once for each DW. Once you've pasted in the new table object into all the DW's, you can then open whichever DW object needs the new field and place it where you need it. This should take all of about 10 minutes once you've done it a couple times.

One word of warning though: If any of your shared DW's have columns with dropdown lists, radio buttons, checkboxes, DDLBs, or anything that causes "values=" at the end of the table/column definition, this will overwrite them, so make sure you've gone through and compared each DW to master to see if there are any and put them on the master DW before pasting over anything. So far I haven't had anything remove the values= data unless you place the GUI field and set it's edit style (then it will wipe it, and you can either replace it from a shared DW in edit source mode, or manually put them back in through the PB GUI on the DW Edit tab).

Hope this helps.

(and before you begin - BACKUP your PBLS!!!)

Comment
There are no comments made yet.
Christopher Craft Accepted Answer Pending Moderation
  1. Thursday, 28 March 2019 15:00 PM UTC
  2. PowerBuilder
  3. # 3

Thanks guys for the input. I was hoping there might be some easy trick out there to accomplish this. Manual maintenance it is!

Hi John - I agree its not a big deal to do it but the problem comes in when you have multiple developers hitting this window. They forget to modify all the other DW's so then our QA department creates a bug report, writes up the document, etc - wasted overhead for something that is so simple to fix. Plus - I always like automating mundane tasks!

Chris Craft

Comment
There are no comments made yet.
Christopher Craft Accepted Answer Pending Moderation
  1. Thursday, 28 March 2019 15:12 PM UTC
  2. PowerBuilder
  3. # 4

One other note - I have never used Query Objects before but I would have thought if you modified the query there would be a way to refresh all the other DW's that used that object for its data source but I do not see anything like that. If that's the case whats the point of using a query object?

Chris Craft

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 28 March 2019 16:22 PM UTC
Hi Chris;

That would seem like a logical approach but changing the Query object's SQL after the DWO(s) are built has no effect on the saved DWO's. The Query Object feature was (and still is) a fast way to build a set of DWO's that require the same DML statement without having to painfully go through the SQL Painter each time a new DWO is created. PowerSoft never went any further after that feature was introduced to "synchronize" DWO's DML built from a "Query Object". However, their was a utility as part of the PB Toolkit from PowerSoft (included with the PB IDE) called the "DW Synchronizer" that could do that for you. However, Sybase dropped that feature (unfortunately).

Regards ... Chris
  1. Helpful
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.