Database Query

We are having issues with querying data from a view in one of our datasources.  When attempting to run the queryEntity, we get the following error.

"Expression evaluation error at function a!queryEntity [line 20]: An error occurred while retrieving the data."

The server log indicates a timeout occurred, however if I run a process model with the Query Database node and a SQL statement, the node returns the correct values in considerably less time than our timeout settings.

Thoughts?

 

Bryant

+++++++++++++++ Code Snippets ++++++++++++++++++

 

Query Entity:

a!queryEntity(
  entity: cons!SMTS_EV_PROJECT_SUMMARY_DSE,
  query: a!query(
    selection: a!querySelection(
      columns: a!queryColumn(
        field: "subprojectId"
      )
    ),
    filter: a!queryFilter(
      field: "subprojectId",
      operator: "=",
      value: 30509
    ),
    pagingInfo: a!pagingInfo(1,1)
  )
)

 

SQL Statement:

select subprojectId, bac from evm.ProjectCurrentBaselineSummary where subprojectId = 30509

 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi  by any chance, did you try doing the same using QueryRule. If YES, then is that returning the proper response? and if NO, then can you please try QueryRule once for the same requirement, where you fetch all the column value for that particular row having subprojectId = 30509


    I understand, you are not willing to go for Query Rule, but try this once for debugging sake, because i just want to figure out, your view is returning the response, only when you are executing Native SQL Query Statement, or it's working in case of Appian generated Queries(generated by QueryEntity, QueryRule) as well.

    If the Query Rule is returning the proper response, then try using QueryEntity at the same time, and check whether the response is proper or again timeout, because while in DEV, i too have come across through many cases, where we used to get timeout, because MySQL used to get Down for couple of seconds, which generally should not happen while in production.

    So just have a QueryRule for Debugging, and let's observe the response.

     

    Hope this will help you..

  • I've tested with a query rule as well and get the following error message:

    "Expression evaluation error in rule 'smts_getevtat2subprojectsummary' at function 'queryruleexec': Error evaluating function 'queryruleexec' : Unexpected error executing query (type: [SMTSEVSubProjectSummaryDT6168], query: [SMTS_GetEVTAT2SubprojectSummary], order by: [[]], filters:[(subprojectId = TypedValue[it=1,v=30509])])"

    I can run the process model with the query node immediately before or immediately after executing either the query rule or the query entity and in both cases the process model returns the expected data in less than 1 sec.

    Thanks
Reply
  • I've tested with a query rule as well and get the following error message:

    "Expression evaluation error in rule 'smts_getevtat2subprojectsummary' at function 'queryruleexec': Error evaluating function 'queryruleexec' : Unexpected error executing query (type: [SMTSEVSubProjectSummaryDT6168], query: [SMTS_GetEVTAT2SubprojectSummary], order by: [[]], filters:[(subprojectId = TypedValue[it=1,v=30509])])"

    I can run the process model with the query node immediately before or immediately after executing either the query rule or the query entity and in both cases the process model returns the expected data in less than 1 sec.

    Thanks
Children