&sql(.....) not working in and returns SQLCODE -400 if try to execute in non persistent cls , -30 in other persist cls
I have written below method inbound adapter myAdapter Extends Ens.InboundAdapter [ ProcedureBlock ] returns -400
If i have written in any other
{
set msgCount=-1
&sql(SELECT count(ID) INTO :msgCount FROM Ens.MessageHeader)
If SQLCODE=0 Quit msgCount
Quit SQLCODE
}
Could you please some one tell me where should write this class method? What I am doing wrong?
Thanks
PRASHANTH
Product version: IRIS 2020.1
I created a simple inbound adapter and a simple business service that uses it, and the &sql() call succeeds for me. It would be good to check the event log and see if any additional error information got logged.
Thanks Marc , you are correct. This code was written long back and available in live . I need to do some enhancements on top of the existing code. I have exported from live and deployed in my local HS setup for development.
I am seeing this error. Live still it is working fine.
Is there any problem with my local HS installation?
Thanks,
Prashanth
Does my sample code work in your local HS installation?
I have tested , not working . Could you please tell me where can i see the log in management portal for below 2 statements
In the management portal you can view that under System Explorer >> Globals. From terminal you can use zwrite. In both cases, make sure you're in the correct namespace:
Thanks Marc,
no luck , see the log below for exampleBS
^ztest("66029,63544.417241","SQLCODE")=-400
^ztest("66029,63544.41725","suspendedCount")=-1
^ztest("66029,63549.440962","SQLCODE")=-400
^ztest("66029,63549.440972","suspendedCount")=-1
^ztest("66029,63554.469506","SQLCODE")=-400
^ztest("66029,63554.469512","suspendedCount")=-1
^ztest("66029,63559.484237","SQLCODE")=-400
^ztest("66029,63559.484244","suspendedCount")=-1
^ztest("66029,63564.510576","SQLCODE")=-400
^ztest("66029,63564.510586","suspendedCount")=-1
^ztest("66029,63569.551258","SQLCODE")=-400
^ztest("66029,63569.551266","suspendedCount")=-1
^ztest("66029,63574.596674","SQLCODE")=-400
^ztest("66029,63574.596684","suspendedCount")=-1
^ztest("66029,63579.611594","SQLCODE")=-400
^ztest("66029,63579.611599","suspendedCount")=-1
You can log %msg to get more information about the error:
Your last finding signals to me that you get blocked by [ProcedureBlock]
either try using %suspendedCount instead of suspendedCount
or put it into a PublicList together with SQLCODE
https://docs.intersystems.com/iris20211/csp/docbook/DocBook.UI.Page.cls?KEY=ROBJ_method_publiclist
thank u
thank u
Thanks Robert ,
my version is:
I literally struck from last two week only because of this issue. Could you please help me.
I need to execute below query in inbound adapter.
Marc mentioned in previous post His example business service is working fine for the same requirement.
What wrong with my HS version? or please show me the way forward.
Thanks a lot
Prashanth
I think this should work if your namespace is enabled for Ensemble / Interoperability
Check this in SMP:
SELECT count(ID) FROM Ens.MessageHeader
ClassMethod FetchMsgCount() As %Integer [ PublicList = msgCount,SQLCODE ]
{
set msgCount=-1
&sql(SELECT count(ID) INTO :msgCount FROM Ens.MessageHeader)
If SQLCODE=0 Quit msgCount
Quit SQLCODE
}
or just simpler
ClassMethod FetchMsgCount() As %Integer
{
set msgCount=-1
&sql(SELECT count(ID) INTO :msgCount FROM Ens.MessageHeader)
If SQLCODE=0 Quit msgCount
Quit SQLCODE
}
Thanks Rabert for your presious time ,
Unfortunately it is not working .
here problem is , it is working fine with out any workaround in Live . Getting this error in Dev (Laptop) only. Is this any permission issue?
same code is giving -30 in other cls which is extends Persistent.
{ ClassMethod FetchMsgCount() As %Integer
{
set msgCount=-1
&sql(SELECT count(ID) INTO :msgCount FROM Ens.MessageHeader)
If SQLCODE=0 Quit msgCount
Quit SQLCODE
} }
this code is giving always -30
which means table does not exist.
which means table does not exist.
SO your namespace is not setup for Interoperability aka Ensemble
as you use Studio jus look for some Ens* classes
if you see nothing of them,
then the setup of your namespace is just wrong
You have to create it again or change your configeratiion manually.
I can see that folders in workspace namespace tab.
not available in project tab
There's a mismatch. You see the code but no data at runtime.
Project is always just a subset of Namespace
Thanks Robert,
I extended my Namespace with %sys. Due to this I faced all the above issues. As per your suggestion, I have created new namespace extending HSSYS. Now all issues got resolved.
Thank you so much for your help.
Thanks Robert,
I extended my Namespace with %sys. Due to this I faced all the above issues. As per your suggestion, I have created new namespace extending HSSYS. Now all issues got resolved.
Thank you so much for your help.
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue