User bio

Long time developer with intersystems technology, I'm working for InterSystems in Italy on the TrakCare side.

Member since Jun 13, 2016
Replies:

You need to change your cursors names, use two different names in your declare statements, try it.

Some considerations about embedded SQL cursors:

1) I think using embedded SQL Cursors is a practice to be avoided in favor of %SQL.Statement class usage: 

https://docs.intersystems.com/iris20232/csp/docbook/Doc.View.cls?KEY=GSQ...

2) Genarally is not  a good idea to have the same name in embedded SQL cursors, even if they are in different Methods, this because of the behaviour of the Stack separations used by the embedded SQL cursors.

3) Use a close statement before every open statement of embedded SQL cursors, this prevent problems if your process crash and in the same context you re execute it.

It works also for me... maybe it depends on how Michael Wood is passing the json object to the method... 

If he is passing a string, there is a conversion needed from string to %DynamicAbstractObject like:

Set str="{""prio"":""2"",""code"":""A001""}"
Write str
{"prio":"2","code":"A001"}
Set obj=##Class(%DynamicAbstractObject).%FromJSON(str)
Write obj
1@%Library.DynamicObject
ZW obj
obj={"prio":"2","code":"A001"}  ; <DYNAMIC OBJECT>
Certifications & Credly badges:
Davide Vittorio has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Following:
Davide Vittorio has not followed anybody yet.