Question
· Aug 31, 2022

SQL query count data type

Hi Guys,

My understanding is that Count in SQL query returns a integer but I'm using this query in a loop where is the count is bigger than 2 skip and go to next record but it looks like it's not doing it, because I'm expecting that ^badis("retries",2,ID) will always be 2 or less but ^badis("retries",2,ID) did have 4 or 5 and I'm thinking that TryCount is actually not a number that's why Continue:TryCount>2 didn't work?

 

 &SQL(SELECT count(*) INTO :TryCount FROM MSDS_Common.ScheduleTaskListHistory WHERE ScheduleTask=:ID)
Set:SQLCODE TryCount=0
^badis("retries",1,ID)=$G(TryCount)
Continue:TryCount>2
^badis("retries",2,ID)=$G(TryCount)
 

Thanks

Product version: Caché 2014.1
Discussion (1)1
Log in or sign up to continue