User Answers


instead of FOR EACH which obviously uses a nonexisting   Next method
you could create a loop using <WHILE> and do a "manual" loop.

For the condition   source.retorno.datos.polizas.poliza.%Size() gives you the  index limit

and source.retorno.datos.polizas.poliza.%Get(idx).sucursal   .... and similar provides the content.

You can get the pid without iteration.

set nsp=$znspace
set pid=^$|nsp|lock("^DBLock(""Patient"",1119102928)","OWNER")

do $system.Process.Terminate(pid)


|nsp| is only required for access to a lock in a different namespace.

as you describe it you refer to a file outside Caché and Caché has no control over it
its a clear case of data inconsistency

you have 4 options:
1a) create a fake file at that reference an delete it then

1b) add an "on before delete" trigger to check and fix in advance either in the record or  in file system 

2a) manipulate the file reference using the object behind your entry

2b) do the delete at object level, trap the error and ignore it. since the file is gone anyway 

when you generate Classes from XSD you require a reference. That' s where xsd is stored.  It may make sense to ich copy it first to your default repository and generate your classes after.

In fact, I see not 1 but 2 tables that share the same global.

so it might be easier to have 2 separated definitions one with and the other without the  4th subscript (some $h)

for access with SQL you than can use a UNION to assemble them. like

I tried it now in Caché 2016.2.2 manually overwriting Storage <Type>%Storage.Persistent</Type>.

During compilation it gets automatically set back to <Type>%Library.CacheStorage</Type>
Also in class defintion.

Does this automatic change go back to repository ??? 

It's really a matter of taste.

If you don't like the long list of params (especially with lousy documented methods) you can

#1) use 1 single param and pass a local array byRef .  and decode it yourself eg:



do  ##class(my.par).method(.par)