Robert Cemper · Nov 13, 2019 go to post

by default IRISLIB is always read-only mounted as it holds most of system methods, utilities, compiles, ...
all code that just executes but not changes during runtime  and that you should not try to change

differently, IRISSYS holds all dynamic system data that can change during runtime and therefore requires read-write access
As configurations, namespace tables, .....

Though with system management privileges you may change this.
But I'd recommend not to touch it unless you are an in-depth IRIS expert.

Robert Cemper · Nov 13, 2019 go to post

SqlComputeOnChange   should trigger on INSERT

while it should trigger only if the value is CHANGED by an UPDATE.

If you need recalculation in any case you may use an ordinary Update  TRIGGER  to adjust your property as you need.

Robert Cemper · Nov 9, 2019 go to post

Right!

But without Git (several years back) . . . . . . . .
It's a matter of organization and discipline anyhow.  

Robert Cemper · Nov 8, 2019 go to post

another way to explain your phenomenon:

  • assume you have a.INC
  • assume inside you have #DEFINE vaXYZ
  • next, you have b.INC with an #include a
  • now your class C with include b and using $$$vaXYZ compiles fine
  • later #DEFINE vaXYZ is  removed from a.INC
  • NOTHING HAPPENS
  • you have constructed a time bomb
  • long time later you do any change on class C
  • now your bomb crashes your compilation

I experienced such a case where the bomb was sleeping for 5 years.
Nobody remembered the change of a.INC and not the reason for the change.

Robert Cemper · Nov 8, 2019 go to post

if your class inherits from some other the include may have gone there? 
typically explained by:  "We do not reference it here. "
 

Robert Cemper · Nov 8, 2019 go to post

It seems that you have lost the ????.inc the includes the definitions of
$$$vaExtentGbl
$$$vaSegment
$$$vaSegmentGbl
$$$vaDataSegName
$$$vaDataDocName
either you  lost the related Include statement or the whole file is lost sad

So in Studio run a "search in files" over *.inc for 

#Define vaExtentGbl
#Define  vaSegment
#Define  vaSegmentGbl
#Define  vaDataSegName
#Define  vaDataDocName
to find out which .inc you are missing.

The query you changed is totally unrelated to it, as far as it seems. 

Robert Cemper · Nov 6, 2019 go to post

OK.
It took some investigations to understand what's going on.

the is a Class Parameter XMLUSEEMPTYELEMENT = 1;
it switches between <Ping></Ping>  and <Ping />

BUT: if ALL Properties of your reply are empty then you just get 
an empty body  <soapenv:Body></soapenv:Body>

as soon as you set some dummy value into Property Ping you get  <Ping> </Ping>
or you add a dummy property.

Digging into %SOAP.... message classes shows, that the generated messages don't use XMLUSEEMPTYELEMENT parameter.
 

Robert Cemper · Nov 6, 2019 go to post

if you add to your data class

Class NAMEHERE.myDate ClassType = datatype, ClientDataType = DATE, OdbcType = DATE, Not ProcedureBlockSqlCategory = DATE ]

these 2 methods you get a kind of self healing code.
It is accessed every time you load or save your property 

ClassMethod LogicalToStorage(in As NAMEHERE.myString ""As NAMEHERE.myDate CodeMode = expression ]
{
$s(+in'=in:$zdh(in),1:in)

}
ClassMethod StorageToLogical(in As NAMEHERE.myString ""As NAMEHERE.myDate CodeMode = expression ]
{
$s(+in'=in:$zdh(in)
,1:in)
}
Robert Cemper · Nov 5, 2019 go to post

Hi Alex,

 "in logical Mode the date shows normal format, in my case, for example 10/1/2019"

in logical mode you get the pure content from global which is here  NOT a $H value !!

$ZD() expects an Integer to convert    =>   it is just +"10/1/2019" => 10

then $ZD(10) = " 10/1/1841"    

So it seems that some of your Dates are not stored using DisplayToLogigal resulting in an Integer
but written directly (e.g. coming from ZEN) into your object / global.

To fix it you may run something like   if +in'=in set in=$zdh(in))

Robert Cemper · Oct 30, 2019 go to post

For a more precise explanation:

Table definitions with ALL indices are required and the complete query plans not just a summary.

And also your version ( $ZV )

Robert Cemper · Oct 29, 2019 go to post

If RESTR_DATETo you try to change is part of the Idkey you can't do an UPDATE on it.

Instead you need an INSERT with new Contents and DELETE of the old.

Robert Cemper · Oct 28, 2019 go to post

and with ROW number

select %VID as Row ,* from (
   SELECT  age ,
    (Select sum(i.age) from sample.person i 
     where i.id <= o.id and age < 20 ) as SubTotal
   FROM sample.person o 
   where age < 20

)

 

Robert Cemper · Oct 28, 2019 go to post

As your table is not available I took a Table from SAMPLES using a subselect

SELECT age ,
     (Select top all sum(i.age) from sample.person i 
      where i.id <= o.id and age < 20 ) as SubTotal
FROM sample.person o 
where age < 20

 

 

Robert Cemper · Oct 26, 2019 go to post

"cautionary M tales" is really ages old and outdated.

But see it from reverse side: You can run without any change code that was written 40 years ago on PDP-11
I've seen it and can confirm it.
I know of no other system that allows spanning that range of time without touching the code.

But you are not forced to write that style. Or you can even write your code in BASIC if you dislike COS.

Robert Cemper · Oct 25, 2019 go to post

IN expects a series of  values  like In (1,5,23,7)

but  :portCode supplies a String as 1 single value "'AB','TS','SK','GM'"   which is useless

better use

SET portCode = $lb("AB","TS","SK","GM")

and 

SELECT STRING(Descrtiption,' (',Code,')'as Description,Code FROM Test.Codes 
WHERE Code  %INLIST  :portCode

Robert Cemper · Oct 13, 2019 go to post

As I see from code

^OPNLib.Game.CWLF

   

is just a Global variable to maintain the actual state of the display structured by Worlds and Display lines.
And it rebuilds the image in cyles.

It has nothing to do with the class definition but is an independent structure.
So you just see it in various methods.

Robert Cemper · Oct 9, 2019 go to post

Honestly, I never saw an <INVALID OERF> related to a lack of memory.

It typically happens if you do set obj=##class(MyClass).%OpenId(id,,.status)  and do not check for success.

https://cedocs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25Library.Persistent#METHOD_%OpenId

so if you missif '$isobject(obj)  {  .... error processing  using status....} or similar

then the next access to obj.MyProperty will throw  <INVALID OERF>

Only checking the status will tell you if  you really ran out of memory

Robert Cemper · Oct 7, 2019 go to post

The management portal has various screens with update features. (e.g Job status)

Íf IRIS service stops the update fails with a timeout.  This is your alert.

Robert Cemper · Oct 7, 2019 go to post

with

&SQL(SELECT MAX(ID) FROM Cinema.Film)

you eliminate the need of ORDER BY ... and save time

Robert Cemper · Sep 23, 2019 go to post

ERROR <Ens>ErrException: <METHOD DOES NOT EXIST>zCopyFrom+28^%Stream.TmpCharacter.1 *Rewind

Pls. add Version. (I couldn't identify any REWIND in CopyFrom)

Robert Cemper · Sep 23, 2019 go to post

If you don't have a similar drive you may need to update %installdir%\cache.cpf

[Journal]
AlternateDirectory=C:\InterSystems\Cache\mgr\journal\
BackupsBeforePurge=2
CurrentDirectory=C:\InterSystems\Cache\mgr\journal\
DaysBeforePurge=2

 

if this isn't enough 

startup Caché in emergency mode as described : 
 https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCAS_secmgmt#GCAS_secmgmt_emerg

and run  DO ^STURECOV from namespace %SYS

it allows you to disable Journal Checking for the next startup.
then restart Caché

Robert Cemper · Sep 22, 2019 go to post

almost done

do @aa

But be aware that variables you pass to your method are either explicit as in your example

or are variables in global scope.   eg. %par1, %par2, ...