Skip to main content
1-Visitor
October 29, 2024
Solved

DB entity service return null when calling from another entity

  • October 29, 2024
  • 1 reply
  • 683 views

GY_10982725_0-1730180106013.png

I have a service on a database entity, executing a simple select max() operation, when running in the entity, it works and returns a result (number) as shown in the screenshot. but when I call this service from another db entity as below: 

   

    lastTickTimeStamp = Things["Egress_KCT_FTAE"].Get_Last_TicksTimeStamp_Test();

 

it always return null as lastTickTimeStamp;

However, the other serivce (query to return an infotable) on the Things["Egress_KCT_FTAE"] can work in the same location without problem.

Best answer by Bikash_Panda

The SQL service returns an infotable, so  to get the value you might need to do lastTickTimeStamp .rows[0].lastTickTimeStamp. Use alias in the SQL like MAX(lastTickTimeStamp ) AS lastTickTimeStamp 

1 reply

14-Alexandrite
October 29, 2024

The SQL service returns an infotable, so  to get the value you might need to do lastTickTimeStamp .rows[0].lastTickTimeStamp. Use alias in the SQL like MAX(lastTickTimeStamp ) AS lastTickTimeStamp 

Community Moderator
November 4, 2024

Hello @GY_10982725,

 

It looks like you have a response from a community member. If it helped to answer your question please mark the reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.