Robert Cemper · Feb 19, 2023 go to post

in iris.script for NSP %SYS add

set par("AutheEnabled")=64
set tSC=##class(Security.Applications).Modify("/csp/sys",.par)

the disadvantage:
You are UnknowUser and might need to add the required Roles as well.

set role="%All"
set tSC=##class(Security.Users).AddRoles("UnknownUser",.role,1)

----------------------
my personal approach is to have a fixed port for SMP
and save my   _SYSTEM / SYS in browser with autofill.
 

Robert Cemper · Feb 19, 2023 go to post

this shows how $QS could be used for a partial global listing
it only checks the second subscript and writes the value for a match

SAMPLES>k ^rcc
SAMPLES>f i=12:1:19 s ^rcc($j,i)="SUB1=J,"_i
SAMPLES>f i=12:1:15 f j=14,17 s ^rcc($j,j,i)="SUB1="_j_",SUB2="_i
 
SAMPLES>zw ^rcc
^rcc(9372,12)="SUB1=J,12"
^rcc(9372,13)="SUB1=J,13"
^rcc(9372,14)="SUB1=J,14"
^rcc(9372,14,12)="SUB1=14,SUB2=12"
^rcc(9372,14,13)="SUB1=14,SUB2=13"
^rcc(9372,14,14)="SUB1=14,SUB2=14"
^rcc(9372,14,15)="SUB1=14,SUB2=15"
^rcc(9372,15)="SUB1=J,15"
^rcc(9372,16)="SUB1=J,16"
^rcc(9372,17)="SUB1=J,17"
^rcc(9372,17,12)="SUB1=17,SUB2=12"
^rcc(9372,17,13)="SUB1=17,SUB2=13"
^rcc(9372,17,14)="SUB1=17,SUB2=14"
^rcc(9372,17,15)="SUB1=17,SUB2=15"
^rcc(9372,18)="SUB1=J,18"
^rcc(9372,19)="SUB1=J,19"
 
set glob="^rcc",last=14,start=13

SAMPLES>print
a        for  {
         set glob=$q(@glob,1,val) quit:glob=""
         set sub=$qs(glob,3)
         if sub=start write glob," >> ",val,!
         else  if sub]start,sub']last write glob," >> ",val,!
         else  write glob,!
         }

SAMPLES>d a
^rcc(9372,12)
^rcc(9372,13)
^rcc(9372,14)
^rcc(9372,14,12)
^rcc(9372,14,13) >> SUB1=14,SUB2=13
^rcc(9372,14,14) >> SUB1=14,SUB2=14
^rcc(9372,14,15)
^rcc(9372,15)
^rcc(9372,16)
^rcc(9372,17)
^rcc(9372,17,12)
^rcc(9372,17,13) >> SUB1=17,SUB2=13
^rcc(9372,17,14) >> SUB1=17,SUB2=14
^rcc(9372,17,15)
^rcc(9372,18)
^rcc(9372,19)
 
Robert Cemper · Feb 10, 2023 go to post

Hi @Julius Kavay 
Sorry to see you leaving. Though I understand your concerns.
I will miss your high-quality contributions that are based on a long and successful experience!
Let's stay in contact

 

Robert Cemper · Feb 10, 2023 go to post


Hi @Stefan Cronje !
I share many of the concerns you raised:

  • aged and outdated and dead packages
  • extra points are given for PR and Merges, but most PS are ignored
  • besides my own 402 reviews only 80 others
  • no options for a release-related  review
  • enough dead links
  • missing an ISC-controlled repo  
Robert Cemper · Feb 6, 2023 go to post

quite interesting.
OEX was unreachable just now for some time
and now my previous voting is gone.
no problem, I still remember.
It's a warning to other early voters.

Robert Cemper · Feb 6, 2023 go to post

I would have been surprised if you knew ZZQ
It's my personal customized COS command for DO $SYSTEM.SQL.Shell()
But I'm also aware you are selling and pushing PY.  OK
And I use happily COS and its predecessor for 45 years which made ISC big
And I dislike black painting its values.

Robert Cemper · Feb 6, 2023 go to post

@Guillaume Rongier 
your terminal example is just poor , (sorry!)  pauvre
I do it his way, easy to read and easy to follow, (your notation)

SAMPLES>zzq
SQL Command Line Shell
----------------------------------------------------
The command prefix is currently set to: <<nothing>>.
Enter q to quit, ? for help.
SAMPLES>>  << entering multiline statement mode >>
        1>>CREATE TABLE test.formation (
        2>>    name varchar(50) NULL,
        3>>    room varchar(50) NULL
        4>>)
        5>>go
1.      CREATE TABLE test.formation (
            name varchar(50) NULL,
            room varchar(50) NULL
        )
 
0 Rows Affected
statement prepare time(s)/globals/lines/disk: 0.0122s/1724/14836/0ms
          execute time(s)/globals/lines/disk: 0.4004s/68198/594881/177ms
                          cached query class: %sqlcq.SAMPLES.cls47
---------------------------------------------------------------------------
SAMPLES>>  << entering multiline statement mode >>
        1>>INSERT INTO test.formation
        2>>(name, room)
        3>>VALUES('formation1', 'salle1')
        4>>go
1.      INSERT INTO test.formation
        (name, room)
        VALUES('formation1', 'salle1')
 
1 Row Affected
statement prepare time(s)/globals/lines/disk: 0.0113s/2622/28346/0ms
          execute time(s)/globals/lines/disk: 0.0009s/13/143/0ms
                          cached query class: %sqlcq.SAMPLES.cls48
---------------------------------------------------------------------------
SAMPLES>>q
SAMPLES>
Robert Cemper · Feb 6, 2023 go to post

This is just cool!
I tried it with my Stream example using xDBC  and no fake mimic.

Robert Cemper · Feb 4, 2023 go to post

Before IRIS there was a trial version. But always only the latest.
There was also no community.  as we know it today.
What you look for is more than 10 years back ! 

Robert Cemper · Jan 27, 2023 go to post

this might do it:

Class User.Scott 
{
ClassMethod Clean(infile, outfile) As %Status
{
  set in=##class(%Stream.FileCharacter).%New()
  do in.LinkToFile(infile)
  set out=##class(%Stream.FileCharacter).%New()
  set out.Filename=outfile
  do in.Rewind()
  while 'in.AtEnd {
    set line=in.ReadLine()
    set last=($e(line,*)="|")
    if last set sc=out.WriteLine(line)
    else  set sc=out.Write(line)
  }
  do in.%Close()
  set sc=out.%Save()
  quit sc
}
}
Robert Cemper · Jan 27, 2023 go to post

Just to understand your requirements correctly.
- a linebreak  $c(13,10)  would only be acceptable if it follows a segment terminator "|" 
- IF YES Is this just a pipe | or a double pipe || as in your example?
This could be a processing rule to check the last chars of the line
and ignoré the linebreak at a mismatch.   
 

Robert Cemper · Jan 23, 2023 go to post

In IRIS you have in SMP the option to run your Query in background and bypass the timeout.

Robert Cemper · Jan 23, 2023 go to post

it still exists:

ClassMethod Build(f As %Integer)
{
 s a="#" f i=F:-1:1 w ?i,a,! s a=a_"##"
}
Robert Cemper · Jan 23, 2023 go to post

Just forget my contribution.
I'm not interested in digging for secrets!
I leave that to Indiana Jones    
my code is deleted ! it's not my type of fun

Robert Cemper · Jan 23, 2023 go to post

Hmm!
Where did you see the enclosing quotes? 
they are invisible in my browser.

Robert Cemper · Jan 22, 2023 go to post

FOUND SOMETHING !

in SMP IRIS you see this header as in Caché / Ensemble

but click to more  has a surprise in IRIS

Select foreground and you get all %session, .... that you look for.
Recorded with SPOOL , device 2
 
%CSPsc=1
%ROWCOUNT=0
%ROWID=""
%SNGetQueryStats=1
%SYSLOG=1
%application=<OBJECT REFERENCE>[356@%CSP.UI.Portal.Application]
%caller=""
%class="%CSP.UI.Portal.SQL.Home"
%method="InvokeInstanceMethod"
%msg=""
%obj=<OBJECT REFERENCE>[362@%ZEN.Component.html]
%objlasterror=""
%page=<OBJECT REFERENCE>[20@%CSP.UI.Portal.SQL.Home]
%request=<OBJECT REFERENCE>[1@%CSP.Request]
%response=<OBJECT REFERENCE>[2@%CSP.Response]
%sc=1
%session=<OBJECT REFERENCE>[3@%CSP.Session]
%sqlcontext=<OBJECT REFERENCE>[433@%Library.ProcedureContext]
%tStatement=<OBJECT REFERENCE>[369@%SQL.Statement]
%zenContext="method"
%zenThreadId=39
SQLCODE=0
rs=""
<Private variables>
$zp=14828
$io="|TCP|58771"

Reverse engineering of the SMP page uncovered this new checkbox to me.
Could be it is documented somewhere
HTH

Robert Cemper · Jan 22, 2023 go to post

I could imagine 2 variants:

  • creating a "clone" of the CSP based "synchronous" Queries we know from C/E
    to have the unique session
  • just using xDBC based tools such as Squirrel, DBeaver, WinSQL, .....
    which is probably better since SMP mimics ODBC mode, but doesn't
    use real xDBC connection
  • external xDBC provides a 1:1 connection as a terminal session would do.     
Robert Cemper · Jan 22, 2023 go to post

You are CORRECT
In Caché/Ensemble SMP uses straightforward CSP and you have %session object and %request ...
I verified IRIS 2022.2 and 2022.3:
- SMP runs Queries differently and  neither %session nor %request is visible
by variable »  %inBackground = 1 it indicates working in background
and once completed the Job is gone, but SMP is still around

Robert Cemper · Jan 22, 2023 go to post

As a first step I would try to find out if your Trigger is running in the same process as your CSP
just writing $JOB  with a  $H into a test global. eg.:

set ^stefan($h,$j)="CSP"  for CSP
set ^stefan($h,$j)="TRIGGER"  for the trigger code
;;; or use
do LOG^%ETN()  ; write to ^ERRORS
Robert Cemper · Jan 21, 2023 go to post

As @Enrico Parisi pointed out: IRIS.DAT is an independent structure
The link between file and Namespace is in the ConfigFile (??.CPF) in your install directory.
The file could be located anywhere.
 

Robert Cemper · Jan 21, 2023 go to post

MS Acess typically uses ODBC data sources.
By default, the ODBC35 driver for Cache/IRIS is installed at Cache/IRIS installation time.
You have to configure it (directly or from MS Access)  with Namespace + SuperServer Port
Take care not to mix 32bit mode with 64bit mode depending on your Cache installation

Robert Cemper · Jan 20, 2023 go to post

I use the suggested common method for length calculation

/// write ##class(Golf.Task2).length()
ClassMethod length(
	class = {$classname()},
	method = "Build") As %Integer
{
  #dim methodObj As %Dictionary.MethodDefinition
  set methodObj = ##class(%Dictionary.MethodDefinition).IDKEYOpen(class, method)
  quit methodObj.Implementation.Size
}

also in terminal:
USER>p
         s (b,h)="*" f L=f:-1:1  w ?L,b,! s b=b_h_h
         F i=1:1:f K s,c S ($P(s," ",f-i+1),$P(c,"#",i*2))="" W s,c,!
 
 
 

Robert Cemper · Jan 19, 2023 go to post

You are on the right path, I use deuw and see

some differences grown by history

  • sort ÄÖÜ + ß (sharp S) after Z as by ASCII
  • sort Ä after A, Ö after O, Ü after U  but before Z
  • ignore trema. sort Ä=A, Ö=O, Ü=U   no idea about ß

4 and 5 may contribute to the lastest nonsense of German Language Authoroties
that introduced sharp_S also in uppercase.
<we lived since ever without it and didn't miss anything>

Your case:
You can't change the collation of an existing Global
But you can apply a different collation before first use in SMP
to overwrite default collation of the  DB
System > Configuration > Local Databases > Globals > New Global 

So you set up a global ^TEMP3  with collation German3
and run MERGE ^TEMP3=^TEMP  and have a new collation.

Some time back I set that to have different index collations for
German, Hungarian, Italian, French, Slovenian, ...
see my post Multi Language Sort