Question
· Apr 10, 2022

SQL query confusion

Hi Guys,

I'm a bit confused where if I run a query trough SMP I don't get any result which should be true but if I run the same query from a classmethod I get a query result which shouldn’t be even if I pass any gibberish parameter into my class method because I'm sure there should be any data? see attached  

 

 

Thanks 

   

Product version: Caché 2014.1
Discussion (7)3
Log in or sign up to continue
Class dc.test Extends %Persistent
{

Property As %Integer;

ClassMethod Test()
{

  ..%KillExtent()

  &sql(insert into dc.test(Fvalues(22))
  &sql(insert into dc.test(Fvalues(11))

  label "00007I0Q"
  &sql(select ID into :cnt from dc.test where ID :label)
  
  SQLCODE,":",cnt
}

}

Output for Caché 2018.1:

100:00007I0Q

Output for IRIS 2021.2:

100:

PS: it is a pity that my answer was ignored.