Written by

Technical Architect at OPTIMUS IT INFRA
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

Comments

prashanth ponugoti · Sep 21, 2021

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

0
Robert Cemper  Sep 21, 2021 to prashanth ponugoti

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

0
prashanth ponugoti  Sep 21, 2021 to Robert Cemper

Hi Robert,

Local means , I have ensemble setup in my laptop. 

Thanks,

Prashanth

0
Robert Cemper  Sep 21, 2021 to prashanth ponugoti

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)

0
Marcio Jose Pedroso Dias · Sep 21, 2021

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?

0
Marcio Jose Pedroso Dias  Sep 21, 2021 to Marcio Jose Pedroso Dias

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

0
prashanth ponugoti  Sep 21, 2021 to Marcio Jose Pedroso Dias

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())

0
David Hockenbroch · Sep 21, 2021

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

0