1. Topher Chen
  2. PowerBuilder
  3. Friday, 15 March 2019 02:57 AM UTC

Dear All,

 

As we are using PB 2017 to migrate our legacy system to .Net Assembly, there are hundreds of DataWindows that call this generic function

 

ll_rows = ads_data.Retrieve(lany_args[1], lany_args[2], lany_args[3], lany_args[4], lany_args[5], lany_args[6], lany_args[7], lany_args[8], lany_args[9], lany_args[10], lany_args[11], lany_args[12] , lany_args[13], lany_args[14], lany_args[15])

 

But .Net Assembly doesn't support PBAny type, when we pass 'number', 'datatime', 'decimal' types, it errors.  we were advised to avoid using PBAny, but

 

 

The types of fields passing into this function are dynamic, each DataWindow is different, if we don’t use PBAny type to receive, we may need to turn this generic function call to specific call for hundreds of DataWindows like this

 

ll_rows = ads_data.Retrieve(name, id, amount, “”, “”, “”….)

 

 

which will require massive amount of effort, and the code will look ugly.

 

The above function is encapsulated, is it possible we refactor it? instead of passing  PBAny arguments, can we pass two sets of array, one set for data type, another set is for actual value in String format, and then do the type conversion in there.

 

We did think about using PowerBuilder 2019 to convert DataWindow to .Net, but it doesn't support Sybase.

 

 

Or if there is other way to get around this?

 

 

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Friday, 15 March 2019 04:53 AM UTC
  2. PowerBuilder
  3. # 1

When you say "Sybase" do you mean SQL Anywhere or ASE?  If SQL Anywhere, then there is high chance the final release of PB 2019 will support this for C# development.  If your database is supported, we would recommend you re-consider using the new C# Web API instead of the legacy .NET Web service target.

Comment
  1. Armeen Mazda @Appeon
  2. Friday, 15 March 2019 06:40 AM UTC
We are planning to add a generic ODBC connectivity so theoretically it should work fine with ASE. It's just that as part of our QA cycle we would only be doing extensive testing of SQL Anywhere against this ODBC connectivity. So you would have to test out ASE for yourself. PB 2019 should be released soon so I don't recommend you embark on a big project with the legacy .NET Web services until after you have carefully evaluated the C# Web APIs in the final release of PB 2019 against your database.
  1. Helpful
  1. Topher Chen
  2. Friday, 15 March 2019 08:52 AM UTC
Hi Armeen, many thanks for your suggestion, as we are already started the legacy system migration, much ground work has been done based on PB 2017, if 2019 can help, we are open to that alternative, but we have a project deadline to meet, may I know a clearer date when the version supporting ODBC will be released? I will need to plan accordingly.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Friday, 15 March 2019 17:19 PM UTC
I can't promise... but right now we are hoping for June 2019.
  1. Helpful
There are no comments made yet.
Topher Chen Accepted Answer Pending Moderation
  1. Friday, 15 March 2019 03:05 AM UTC
  2. PowerBuilder
  3. # 2

Sorry, a little correction, as the arguments' types are dynamic, this is how we pass the values dynamically according to the DataWindow

 

Choose case l_datatypes[l_counter]
case 'string'
lany_args[l_counter] = l_values[l_counter]
case 'number'
lany_args[l_counter] = double(l_values[l_counter])
case 'datetime'
lany_args[l_counter] = datetime(date(l_values[l_counter]))
 case 'decimal'
lany_args[l_counter] = dec(l_values[l_counter])
 case else
lany_args[l_counter] = l_values[l_counter]
End Choose

 

_rows = ads_data.Retrieve(lany_args[1], lany_args[2], lany_args[3], lany_args[4], lany_args[5], lany_args[6], lany_args[7], lany_args[8], lany_args[9], lany_args[10], lany_args[11], lany_args[12] , lany_args[13], lany_args[14], lany_args[15])

 

so I can't think of a way to avoid using PBAny in this case. can you guys please help?

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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.