robert.hassel Posted March 1, 2022 Share Posted March 1, 2022 Hi, Can anyone please tell me why this query doesn't work for me in jaspersoft?SELECT bptech.externalId as Partner,COUNT(s.id) as Pocet, sas.Servis , (100/Pocet*sas.Servis) as Percentofrom ServiceCall s, Activity a, ServiceAssignment sa, Person p, BusinessPartner bptech,(SELECT bpteche.externalId as Partner2, COUNT(se.id) as ServisFROM ServiceCall se ,Activity ae, ServiceAssignment sae, Person pe, BusinessPartner bptecheWHERE se.typeName = 'Servis' ANDae.object.objectId = se.id ANDsae.object.objectId = se.id ANDpe.id=sae.technician ANDbpteche.id = pe.businessPartner AND(ae.udf.z_f_ac_zmenaterminu LIKE '%4.%' OR ae.udf.z_f_ac_zmenaterminu LIKE '%5.%')GROUP BY bpteche.externalId) sasWHEREa.object.objectId = s.id ANDsa.object.objectId = s.id ANDp.id=sa.technician ANDbptech.id = p.businessPartner ANDsas.Partner2 = bptech.externalId ANDs.typeName = 'Servis'GROUP BY Partner, Servis Link to comment Share on other sites More sharing options...
bigalex Posted March 1, 2022 Share Posted March 1, 2022 Would you be able to provide the error you see in Jasper? I am just guessing here that Jasper doesn’t like the query line with .object. ( ae.object.objectId) , the error may provide more info on why the query doesn’t work in Jasper. Link to comment Share on other sites More sharing options...
robert.hassel Posted March 2, 2022 Author Share Posted March 2, 2022 The error is very general: CA-158 - The query was cancelled because it takes more then 30 seconds to execuce. In other system this query is finis in 2 seconds... I think there is problem with two SELECT in one query, but I dont know how can write this query without two SELECT. ae.object.objectId works in another query in Jaspersoft. Thank you! Link to comment Share on other sites More sharing options...
bigalex Posted March 2, 2022 Share Posted March 2, 2022 Would you be able to provide the full TEXT error ?Also,check to make sure the sas.Servis and Pocet are not Zero; otherwise, it will be an endless loop in your formula (100/Pocet*sas.Servis). Use NULLIF function - NULLIF(expression1, expression2) to avoid division by zero. Link to comment Share on other sites More sharing options...
robert.hassel Posted March 3, 2022 Author Share Posted March 3, 2022 Thank you. Bellow is full text of error. Pocet and sas.Servis are not zero.com.coresuite.reportdesigner.exception.ReportDesignerException: {"error":"CA-158","message":"CA-158: The query was cancelled because it takes more than 30 seconds to execute.","values":[],"id":"bc9d96e87c1244668c9eef21d60cd7e3"} at com.coresuite.reportdesigner.client.HttpClient.call(HttpClient.java:153) at com.coresuite.reportdesigner.client.HttpClient.get(HttpClient.java:54) at com.coresuite.reportdesigner.client.CloudClient.readQuery(CloudClient.java:178) at com.coresuite.reportdesigner.query.CoresuiteFieldsProvider.getFields(CoresuiteFieldsProvider.java:74) at com.jaspersoft.studio.data.coresuite.CoresuiteDataAdapterDescriptor.getFields(CoresuiteDataAdapterDescriptor.java:57) at com.jaspersoft.studio.property.dataset.dialog.DataQueryAdapters.doGetFields(DataQueryAdapters.java:525) at com.jaspersoft.studio.data.designer.AQueryDesignerContainer$1.run(AQueryDesignerContainer.java:49) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) Link to comment Share on other sites More sharing options...
bigalex Posted March 3, 2022 Share Posted March 3, 2022 It looks like the CA-158 error (SAP) is the same as the HTTP 408 error. Check the article: What Is a 408 Request Timeout and How to Fix It (https://www.exai.com/blog/408-request-timeout-error). I hope this helps. Link to comment Share on other sites More sharing options...
robert.hassel Posted March 9, 2022 Author Share Posted March 9, 2022 Hi, Yes, I read what mean CA-158, but doesn't help me. I think, that this error will be right so other select don't work also with this connection to DB. Every other select with the same connection DB works good, but this one not.Robo Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now