go to post Vitaliy Serdtsev · Sep 6, 2021 Caché SQL Optimization Guide New Video: Optimizing SQL Queries New Video: Optimizing Your SQL Queries SQL Performance Resources I think that's enough for a start ;)
go to post Vitaliy Serdtsev · Sep 6, 2021 Here you will find a lot of useful things in particular $QLENGTH: Using Globals
go to post Vitaliy Serdtsev · Aug 20, 2021 See Base64EncodeStream Or %Atelier.v1.Utils.General:Base64FromStream()
go to post Vitaliy Serdtsev · Aug 20, 2021 See documentation: $ZF(-100) requires the %System_Callout:U privilege. And check "Error Handling".
go to post Vitaliy Serdtsev · Aug 20, 2021 See documentation: Frequently Asked Questions About CSP: How do I debug a CSP page?
go to post Vitaliy Serdtsev · Aug 20, 2021 Why not use numeric codes? $ascii("á") = 225 set s1=$zconvert("Flávio","I","HTML"), s2=$zconvert("Flávio","I","HTML") write s1,$select(s1=s2:" = ",1:" <> "),s2
go to post Vitaliy Serdtsev · Aug 17, 2021 Don't pay attention, someone very needs an Apple iPad. I found a very interesting article about a very ancient language, but it's not Mumps : Banks scramble to fix old systems as IT 'cowboys' ride into sunset
go to post Vitaliy Serdtsev · Apr 30, 2021 How do you count "Count"? Why is "Northwest" 1 instead of 2 for 2021? For now so: select v.Branch, nvl(sum(c %FOREACH(v.Branch)),0) "Count" from ( select 'Northwest' Branch,$listbuild('Northern','Western') Branches union select 'Oriental',$listbuild('Eastern') union select 'Southern',$listbuild('Southern') ) v left join (select replace(%exact(Branch),' branch','') Branch,count(* %FOREACH(Branch)) c from yourtable where year("Date")=2021 group by Branch) m on m.Branch %inlist v.Branches group by v.Branch
go to post Vitaliy Serdtsev · Apr 29, 2021 Can you provide a small sample table with the data and the result you want to get?
go to post Vitaliy Serdtsev · Apr 29, 2021 You are implicitly using %Library.SqlQuery:Func() method, in which, as @Robert Cemper rightly pointed out, $get() is used. You can do it differently: Query GetInfo(pObject AS Kurro.MyClass) As %SQLQuery(CONTAINID = 1, ROWSPEC = "IdList:%String,IdProcess:%String,Duration:%String") [ SqlProc ] { SELECT IdList, IdProcess, Duration FROM Kurro.MyClass WHERE KeyProcess = :pObject.KeyProcess AND CodeSpecialist = :pObject.CodeSpecialist AND CodeProvider = :pObject.CodeProvider AND CodeCenter = :pObject.CodeCenter AND "Date" = :pObject.Date } set obj=##class(Kurro.MyClass).%New() set obj.KeyProcess="1033004-1#" set obj.CodeSpecialist = "surgery" set obj.CodeProvider = "PR002" set obj.CodeCenter = "CENTER-01" set obj.Date = $ZDATETIME($ZDATETIMEH("2021-04-30 15:45:00",3,1),3,1) set st=##class(%SQL.Statement).%New() set sc=st.%PrepareClassQuery("Kurro.MyClass","GetInfo") if $$$ISERR(sc) {write "%PrepareClassQuery failed:" do $System.Status.DisplayError(sc) quit} set result=st.%Execute(obj) do result.%Display()
go to post Vitaliy Serdtsev · Apr 29, 2021 I don't quite understand what you want to get. If in the forehead, then so: Select v.valueId, m.name From (Select 1 valueId Union Select 2 Union Select 3 Union Select 4 Union Select 5) v left Join otherTable m on m.id = v.valueIdBut you can achieve the same thing more easily through IN or %INLIST.
go to post Vitaliy Serdtsev · Apr 16, 2021 You can easily do this by replacing two values in the registry. Just checked on Caché & IRIS: SMP and Terminal (##class(%SYS.System).GetInstanceName()) displays the new instance name. Upgrade/Deinstall work fine too. If desired, you can also replace the service names (private Apache, etc.).
go to post Vitaliy Serdtsev · Apr 15, 2021 Then add a role with the appropriate permissions to your web application: Editing an Application: The Application Roles Tab Don't forget to restart the web app after that for the changes to take effect
go to post Vitaliy Serdtsev · Apr 15, 2021 You don't need to grant rights to the users whose properties you want to get. Access rights (resource %DB_CACHESYS:R) you need to give the user from which your GetUserInfo method will run.
go to post Vitaliy Serdtsev · Apr 14, 2021 Your user must have access privileges to the %SYS namespace: SET $NAMESPACE
go to post Vitaliy Serdtsev · Apr 14, 2021 There's clearly something wrong with the settings here. What web server do you use, did you configure something in the CSP Gateway? Is the error reproduced when accessing (edit&compile) pages from USER/SAMPLES (of course, if you have them installed)?
go to post Vitaliy Serdtsev · Apr 13, 2021 If you use Studio to edit/compile *.csp files, check the following parameters: Enable service status check (Recommended) (yes) Studio is active application (2–60 sec) (5) Studio is background application (30–600 sec) (60) Automatically reload document when it is modified on the server and it has not been edited in Studio (yes) And also see Caché Launcher (Cube) settings : Web Server IP Address / CSP Server Instance I tried to simply edit the file in Studio (csp/samples/redirect.csp) and with an external editor FAR Manager ([CACHEROOT]\CSP\samples\redirect.csp) For simplicity, I changed the comment in the header. I tested everything both locally and remotely. So, I change it in Studio - the changes are immediately visible in FAR, I change it in FAR - the changes are immediately visible in Studio. Or in another way: I change it locally - the changes are immediately visible on the remote machine, I change it on the remote machine - the changes are immediately visible locally. In other words, there is no and cannot be any desynchronization, since the work is always done with the same file on the server, see Saving a CSP File.