SELECT count / SELECT sum errors on PACIFIC cloud ??

Posted by spope-rollbase on 31-May-2015 20:45

We developed a simple app in our Rollbase private cloud (Currently Release 3.1.3.0) and installed this in the Pacific cloud for a new customer.. (Yay!)

Problem is that a lot of formula fields for totals and counts are no longer working.

(Many of these totals are for indirectly related objects and requires loops within Loops..)

Eg: Current formula field for displaying a count of outstanding scheduled payments:

var currvehicles = rbv_api.getRelatedIds("R90528", {!id});
var currtot = 0;
for (var k=0; k<currvehicles.length; k++) {
currtot = currtot + Number( rbv_api.selectValue("SELECT count (1) FROM sched_cust_payment where R91199=? and ( ( Actual_Payment_Amount < Expected_Payment_Amount) or Actual_Payment_Amount is null)", currvehicles [k]));
}
return currtot;

The above does not error in our private cloud, but in the Pacific cloud we are getting Errors like: 

ERROR: Error Error in SQL Query Select  count (1) FROM ....... rb_cust4.count does not exist. Check the 'Function Name Parsing and Resolution' section in the reference manual (line #8) [Field: "Outstanding Customer Payments" ......

(the customers installed pacific database was cust4, hence the rb_cust4)

Questions:

  • Is there a fix for this?
  • Has support for Select sum and SELECT count been dropped between 3.1.30 and 3.2.2.2??
  • Is there a more efficient way to do this??

Note:  we plan to change rbv_api.getRelatedIds with begin loop, and end loop, but that is not the problem here.

Posted by spope-rollbase on 31-May-2015 21:13

May be related to spaces between count/sum and the following parenthesis???

Still TBC..

dev.mysql.com/.../function-resolution.html

Posted by spope-rollbase on 01-Jun-2015 15:19

We think the difference is that our private cloud is running an Openedge backend, and the Pacific cloud is running a MYSQL backend, and the SQL may be slightly different. - Will confirm later today if removing the space fixes the issues.

All Replies

Posted by spope-rollbase on 31-May-2015 21:13

May be related to spaces between count/sum and the following parenthesis???

Still TBC..

dev.mysql.com/.../function-resolution.html

Posted by Daniel Figucio on 31-May-2015 23:45

How about Group Functions?

documentation.progress.com/.../group-functions.html

I'll see if I can dig up a example.

EDIT:

EG:

currtot += #CALC_COUNT.sched_cust_payment( 1 | R91199 == currvehicles[k] && ( ( Actual_Payment_Amount < Expected_Payment_Amount) || Actual_Payment_Amount == 0)))

There may be a typo there - but start with that at least.

D.

Posted by Daniel Figucio on 01-Jun-2015 00:49

You may be right, I may have been going down the wrong path with Group Functions...

Posted by spope-rollbase on 01-Jun-2015 15:19

We think the difference is that our private cloud is running an Openedge backend, and the Pacific cloud is running a MYSQL backend, and the SQL may be slightly different. - Will confirm later today if removing the space fixes the issues.

This thread is closed