Question
prashanth ponugoti · Sep 21, 2021

&sql(sql query ) not executing in Extended Business Componets Classes

Hi Community

I have extended my operation class from Ens.BusinessOperation class . I want to execute below sql on cache.

&sql(Select demoVersion into :DemoVersion from demointerface.DemoInstances where ID=:demoID)

this line not even giving error.

Please suggest me how to make sure my sql query should work everytime , when i call the class method

Same code is working fine in production but not working in local:(

Thanks a lot

Prashanth Ponugoti
 

Product version: IRIS 2020.1
$ZV: HS-2020.1
10
1 0 8 126
Log in or sign up to continue

Same code is working fine in production , why it is not working in local

what do you mean by "local" ?
local session,  local instance,  local server ?
assuming "production" runs on a server 

Hi Robert,

Local means , I have ensemble setup in my laptop. 

Thanks,

Prashanth

so you can call the local  commandline ( session  or terminal) and run
your SELECT in SQL shell [  do $system.SQL.Shell() ]
or from SMP System->Explorer->SQL  to see if there is any content.

If there is some content you may try next to use variables from the global scope
for your  embeded SQL
instead of 
&sql(Select demoVersion into :DemoVersion from demointerface.DemoInstances where ID=:demoID)

try it with
&sql(Select demoVersion into :%DemoVersion from demointerface.DemoInstances where ID=:%demoID)

  

Hi.
Maybe its too basic, but, did you try to execute this query into [System Explorer -> SQL -> Execute Query] to see its show any data?

Another think.
Did you see ( or analyse ) the result of SQLCODE of the query?

yes , queries are executing fine in System Explorer -> SQL -> Execute Query. 

yes it returns record aswell. 

Just I have confirm that , object.save() is working fine. (Do o.%Save())

What is the resulting SQLCODE? That should point you in the right direction.