on 2019 Nov 05 11:19 AM
I am facing a weird problem in SQL-Anywhere 10:
CREATE PROCEDURE "dba"."Proc1" () RESULT (total int) BEGIN select sum(col1) from Table1;-- where col1 < 10; END; CREATE SERVICE Service1 TYPE 'XML' AUTHORIZATION OFF USER dba AS CALL "dba"."Proc1" ();
The problem is that the Proc1 works always very fast, but the Service1 works only if I restrict the corresponding rows (for example if I open the comment 'where col1 < 10')
The problem looks to be related to the count of the corresponding rows from Table1, and not related to the result of sum(col1).
In other words, even if the value of each Table1.col1 is 0.0001 then I face the same problem if the (select count(col1) from Table1) is too big.
Is there any explanation and/or solution for this problem?
The only solution which I could find is to write the sum(function) inside an event (which in turns calculates the sum and writes the value of sum in a table T2). Now within proc1 I trigger the event and read the value of sum from T2.
With this approach everything works fine (maybe because the sum function is not anymore related to the webservice and has different connection id).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.