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 miss if '$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, ...

Robert Cemper · Sep 16, 2019 go to post

WRC replied.

The *ENSTEMP databases are just like normal databases (non-journalled). So they are not in-memory databases like IRISTEMP or CACHETEMP.
Also note that transactions in *ENSTEMP will be journaled (like other non-journaled databases) but not like IRISTEMP.

Special thanks to @Mario Sanchez Macias   

Robert Cemper · Sep 14, 2019 go to post

a solution with NO $TRANSLATE

 set str="aN d.ef123$eR=xx?,yWz"
 for i=1:1:$l(str) s:$e(str,i)'?1(1AN,1".",1" ",1",") $e(str,i)=" " 

 aN d.ef123 eR xx ,yWz

Robert Cemper · Sep 12, 2019 go to post

I fear there is no such utility by default. 
You may need to do it manually to see if it is a real problem or a side effect from parallel compiling.

I just verify it by multiple runs on CompileAll to be sure.

 [ I'm  just  facing a list of ~100 including deployed classes    crying ] 

If you have private %classes mapped ito %SYS then you have to compile them manually.

compileAll doesn't include %SYS for good reasons. 

Robert Cemper · Sep 6, 2019 go to post
Insert into LISDB.State (short,long)
SELECT 'AL','Alabama'
Union All
SELECT 'AK','Alaska'
Union All
SELECT 'AZ','Arizona'
Union All
SELECT 'AR','Arkansas'
Robert Cemper · Sep 6, 2019 go to post

From docs.

A host variable is a local variable that passes a literal value ....

see: Host Variables

You are using instead object property references.==>    objSearch.StartIndex,  .....
Load your properties into local variables and it should work

Robert Cemper · Sep 5, 2019 go to post

for details on variable scoping see Summary on Local Variable Scoping

As the SQL Code generator dates from times where ProcedureBlock was unknown
any generated code for SQL access I've seen over decades just works with  [ ProcedureBlock = 0 ]

The 'automatic' you mention is the default if your class is set t to [ ProcedureBlock = 1 ] which is a default.

By changing the variable name you found the best solution yourself.   yes

Robert Cemper · Aug 27, 2019 go to post

Alexey,

you are perfectly correct. My intention was to demonstrate that the ancient approach of 
OPEN and USE command parameters dating from the previous millennium is still valid.

wink
$LB() is definitely the more general and flexible solution. 

yes

Robert Cemper · Aug 26, 2019 go to post

Before you try a re-install ation of Caché  emergency access could be your last chance.

Follow the guide very strictly there is a high risk to cause unrecoverable damage.