1. Michael Connell
  2. PowerBuilder
  3. Monday, 24 January 2022 13:32 PM UTC

Hi,

We have a legacy engineering application written in PowerBuilder (and Oracle) that handles data in metric (SI) units.

There is a customer in the US that is interested in the application, but would like to use US units.

Does anyone know of a simple, straightforward method to convert a PB application that handles data in SI units to handle data in US or Imperial units?

Michael Connell.

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 24 January 2022 13:42 PM UTC
  2. PowerBuilder
  3. # 1

Hi Michael;

   My guess is that your app & db would need to be refactored in order to handle that aspect properly. 

Regards... Chris

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 24 January 2022 14:21 PM UTC
  2. PowerBuilder
  3. # 2

Rename the table and create a view with the old name of the table. The view would look at a config table to see which type of units is desired. If it is US or Imperial, the view would do the conversion, perhaps by calling a user defined db function.

For updating, there would have to be an update trigger that would convert the incoming value to metric, based on the unit type from the config table.

This would require no changes to the PowerBuilder code.

Comment
  1. Chris Pollach @Appeon
  2. Monday, 24 January 2022 21:07 PM UTC
Hi Roland ... of course you would have to change the PB & DW code to input & display the various units as required by the Customer.

Michael: Note that US & Imperial are not that same. For example here in Canada - 4gal = 5 gal US
  1. Helpful 3
  1. Roland Smith
  2. Monday, 24 January 2022 21:17 PM UTC
Only if the desired unit changed per end user. More than likely it will be on a site by site basis.
  1. Helpful
There are no comments made yet.
Michael Connell Accepted Answer Pending Moderation
  1. Tuesday, 25 January 2022 10:42 AM UTC
  2. PowerBuilder
  3. # 3

Guys,

Thank you for your responses.

The view / trigger solution is the solution we're looking at. Although it means little change to the application there's still a lot of work to be done in the DB. I was just hoping that there was some sort of "magic bullet", but apparently not.

I guess this is what I get paid for!

Thanks once again.

Regards,

Michael Connell.

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 25 January 2022 18:16 PM UTC
Yes, getting paid is always good. Also, now you should feel "more needed" too! ;-)
  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.