go to post Vitaliy Serdtsev · Mar 10 IRIS for Windows (x86-64) 2024.3 (Build 217U) Thu Nov 14 2024 17:59:58 EST Or "Include EnsUtil" Now you can do it like this: ##class(%BigData.ShardedSQL).ClassNameToTableName(pClassName)
go to post Vitaliy Serdtsev · Feb 28 See Class Reference: Class %Stream.FileBinaryGzip Extends FileBinary Class %Stream.FileBinary Extends %Stream.Object Hence %Stream.FileBinaryGzip is already the heir of %Stream.Object.
go to post Vitaliy Serdtsev · Feb 4 C:\Program Files\Python313\python3.dll Here is exactly the version 3.9.13, and not 3.13?
go to post Vitaliy Serdtsev · Feb 4 I was interested and I decided to check: USER>w $zv IRIS for Windows (x86-64) 2024.3 (Build 217U) Thu Nov 14 2024 17:59:58 EST USER>d $System.Python.Shell() Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32 Type quit() or Ctrl-D to exit this shell. >>>
go to post Vitaliy Serdtsev · Feb 4 Only InterSystems developers can fix the generated code. To do this, contact the WRC. You and I can only work around the bug by rewriting the query.
go to post Vitaliy Serdtsev · Feb 4 I installed Python 3.12.8 (x64) and configured it according to the documentation (link is given above) Everything is working fine: USER>do $System.Python.Shell() Python 3.12.8 (tags/v3.12.8:2dc476b, Dec 3 2024, 19:30:04) [MSC v.1942 64 bit (AMD64)] on win32 Type quit() or Ctrl-D to exit this shell. >>>By the way, I didn't touch PythonPath.
go to post Vitaliy Serdtsev · Jan 27 The query can be yet simplified: insert or update myTable(name,counter) select 'Omer', nvl((select counter from dc.myTable where name='Omer') + 1, 1)
go to post Vitaliy Serdtsev · Jan 23 And if so? insert or update myTable(name,counter) select 'Omer', case when exists(select * from myTable where name='Omer') then (select counter from myTable where name='Omer') + 1 else 1 endThe "name" field is assumed to be unique.
go to post Vitaliy Serdtsev · Oct 11, 2024 I checked on the version "IRIS 2024.2CE for Windows" - the file is deleted from the SOURCFILE. Maybe it's about the access rights to delete? Check it out: Step 6: Determine Owners and Groups UNIX® Users, Groups and Permissions
go to post Vitaliy Serdtsev · Jun 24, 2024 Try this example Class User.myclass Extends %Persistent { Property myVECTOR As %Vector(CAPTION = "Vector", DATATYPE = "INTEGER"); Property myProperty As %String(MAXLEN = 40) [ Required ]; ClassMethod GetEmbedding1(sentences As %String) As %String { q "2,4,6,8" } ClassMethod GetEmbedding2(sentences As %String) As %DynamicObject { q [1,3,5,7,9] } ClassMethod Test() { d ..%KillExtent() set data=##class(User.myclass).%New() set data.myProperty ="anything 1" set data.myVECTOR=##class(User.myclass).myVECTORDisplayToLogical(##class(User.myclass).GetEmbedding1("this is my text")) d $system.OBJ.DisplayError(data.%Save()) ; OR set data=..%New() set data.myProperty ="anything 2" set data.myVECTOR=data.myVECTORDisplayToLogical(..GetEmbedding2("this is my text")) d $system.OBJ.DisplayError(data.%Save()) zw ^User.myclassD } } USER>d ##class(User.myclass).Test() ^User.myclassD=2 ^User.myclassD(1)=$lb("",{"type":"integer", "count":4, "length":4, "vector":[2,4,6,8]} ; <VECTOR>,"anything 1") ^User.myclassD(2)=$lb("",{"type":"integer", "count":5, "length":5, "vector":[1,3,5,7,9]} ; <VECTOR>,"anything 2")
go to post Vitaliy Serdtsev · Apr 4, 2024 select lpad(s\3600,2,0)||':'||lpad(s\60#60,2,0)||':'||lpad((s)#3600#60,2,0) diff from (select DATEDIFF('s','2024-04-01 09:13:46','2024-04-01 11:11:44') s)
go to post Vitaliy Serdtsev · Mar 29, 2024 See Defining Custom Class Queries Example of a stored procedure Class dc.test [ Abstract ] { Query Intervals( start As %TimeStamp, end As %TimeStamp, minute As %TinyInt) As %Query(ROWSPEC = "intStart:%PosixTime,intEnd:%PosixTime") [ SqlName = Intervals, SqlProc ] { } ClassMethod IntervalsExecute( ByRef qHandle As %Binary, start As %TimeStamp, end As %TimeStamp, minute As %TinyInt) As %Status { s qHandle(0)=##class(%PosixTime).OdbcToLogical(start), qHandle(1)=##class(%PosixTime).OdbcToLogical(end), qHandle=minute q $$$OK } ClassMethod IntervalsFetch( ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ PlaceAfter = IntervalsExecute ] { i qHandle(0)<=qHandle(1) { s j=$system.SQL.Functions.DATEADD("minute",qHandle,qHandle(0)), Row=$lb(qHandle(0),$s(j>=qHandle(1):qHandle(1),1:j-1)), qHandle(0)=j=qHandle(1)+j }else{ s Row="", AtEnd=$$$YES } q $$$OK } ClassMethod IntervalsClose(ByRef qHandle As %Binary) As %Status [ PlaceAfter = IntervalsExecute ] { q $$$OK } } The result of calling a stored procedure in the Management Portal: SELECT * FROM dc.Intervals({ts '2024-01-01 10:00:00'},{ts '2024-01-01 11:00:00'},15) Display/ODBC Mode intStart intEnd 2024-01-01 10:00:00 2024-01-01 10:14:59.999999 2024-01-01 10:15:00 2024-01-01 10:29:59.999999 2024-01-01 10:30:00 2024-01-01 10:44:59.999999 2024-01-01 10:45:00 2024-01-01 11:00:00.000000 Logical Mode intStart intEnd 1154625607806846976 1154625608706846975 1154625608706846976 1154625609606846975 1154625609606846976 1154625610506846975 1154625610506846976 1154625611406846976 Accordingly, your query needs to be rewritten, for example: SELECT intStart, intEnd, COALESCE((SELECT SUM(CASE WHEN value_after_changing = 'GENERATE' THEN 1 ELSE 0 END) FROM service_log WHERE id = 11 AND created_at BETWEEN intStart AND intEnd), 0) generatedCount, COALESCE((SELECT SUM(CASE WHEN value_after_changing = 'FINISH' THEN 1 ELSE 0 END) FROM service_log WHERE id = 11 AND created_at BETWEEN intStart AND intEnd), 0) finishedCount, COALESCE((SELECT SUM(CASE WHEN value_after_changing = 'DROPOUT' THEN 1 ELSE 0 END) FROM service_log WHERE id = 11 AND created_at BETWEEN intStart AND intEnd), 0) dropoutCount, COALESCE((SELECT SUM(CASE WHEN value_after_changing = 'CANCEL' THEN 1 ELSE 0 END) FROM service_log WHERE id = 11 AND created_at BETWEEN intStart AND intEnd), 0) cancelledCount FROM dc.Intervals({ts '2024-01-01 10:00:00'},{ts '2024-01-01 11:00:00'},15)
go to post Vitaliy Serdtsev · Nov 10, 2023 You can convert a list to a string (and vice versa), regardless of the number of nestings. Unfortunately, I can't test this code for Caché 5.x, but I think it should work. Here is a small example of searching for a string in a list: #include %systemInclude n s list=$lb( "test", "for", "searching unknown strings here is a very long piece with enough characters to get a lowercase alpha as a $list marker", "items", "in", "aaatArGetwaaaa", "lists", $lb( "/subs", "/values", "nested list", "did you see that ""w"" before the third piece?", "Stuart Strickland", "Yaron Munz") ) s str=$$$UPPER(##class(%Utility).FormatString(list,,.overflow)) i 'overflow { ;s @("LIST="_str) zw LIST w !,$f(str,$$$UPPER("Targetw")) }Result: 162
go to post Vitaliy Serdtsev · Aug 24, 2023 Alternatively, you can create a custom task that runs every 15 minutes, in which to enable disabled users. Since there are other ways to connect besides CSP, this will be more universal. PS: why not disable "Disable account if login limit reached" and reduce Invalid login limit?
go to post Vitaliy Serdtsev · Aug 23, 2023 Look at the class %SYSTEM.CSP: CSS>d $system.CSP.DisplayConfig() ... CSS>w $system.CSP.GetConfig("DefaultPasswordChangePage") %CSP.PasswordChange.cls CSS>d $system.CSP.SetConfig("DefaultPasswordChangePage","CSS.CSP.ChangePassword.cls") CSS>w $system.CSP.GetConfig("DefaultPasswordChangePage") CSS.CSP.ChangePassword.cls
go to post Vitaliy Serdtsev · Aug 22, 2023 The problem can be solved in two ways: use OPTIONS="popup,sortbox" make a correction to the %CSP.PageLookup Write " <a href=""javascript:searchSort("_..QuoteJS(value)_");"" title=""Sort Results by "_alias_""">" | V Write " <a href=""javascript:searchSort("_i_");"" title=""Sort Results by "_alias_""">" In both case, the query will take the form "ORDER BY <the ordinal number of the field>", instead of "ORDER BY <field name>"
go to post Vitaliy Serdtsev · Aug 11, 2023 One of the possible options: ClassMethod odbcTest() As %Integer [ ReturnResultsets, SqlName = PersonSets2, SqlProc ] { #dim %sqlcontext As %ProcedureContext if '$isobject($Get(%sqlcontext)) { set %sqlcontext = ##class(%ProcedureContext).%New() } s tReturn = 0 s conn=##class(%SQLGatewayConnection).%New() s sc=conn.Connect("TEST Samples","_system","SYS") //datasource if $$$ISOK(sc) { d conn.AllocateStatement(.h1) d conn.Prepare(h1,"select name,dob,spouse from sample.person where name %STARTSWITH 'A'") d conn.Execute(h1) d %sqlcontext.AddResultSet(conn.getResultSet(h1)) d conn.AllocateStatement(.h2) d conn.Prepare(h2,"select name,age,home_city,home_state from sample.person where home_state = 'MA'") d conn.Execute(h2) d %sqlcontext.AddResultSet(conn.getResultSet(h2)) s tReturn = 1 }else{ s sqlcode=$system.Status.StatusToSQLCODE(sc,.msg) s %sqlcontext.%SQLCODE = sqlcode, %sqlcontext.%Message = msg } q tReturn }Output: SAMPLES>d ##class(%SQL.Statement).%ExecDirect(,"call Sample.PersonSets2()").%Display() ...Surely there is a way to make it even easier.
go to post Vitaliy Serdtsev · Aug 10, 2023 Try this: Set objcontato=##class(Contatos.Amiguinho).%New() Do objcontato.MoradiaSetObjectId(3) Do objcontato.TrabalhoSetObjectId(2) Set ret=objcontato.%Save()See Fastest Way to Connect Objects