go to post Sylvain Guilbaud · Sep 18, 2023 Hi @Jimmy Christian another simpler sample : XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ] { <transform sourceClass='formation.RM.personne.Batch' targetClass='common.person' create='new' language='objectscript' > <foreach property='source.Records()' key='k1' > <assign value='source.Records.(k1).Nom' property='target.names.(k1)' action='set' /> </foreach> </transform> }
go to post Sylvain Guilbaud · Sep 18, 2023 Hi @Jimmy Christian, the syntax in XML is : XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ] { <transform sourceClass='formation.RM.personne.Batch' targetClass='formation.msg.mysql.batch' create='new' language='objectscript' > <foreach property='source.Records()' key='k1' > <subtransform class='formation.transfo.personne' targetObj='target.list.(k1)' sourceObj='source.Records.(k1)' /> </foreach> </transform> }
go to post Sylvain Guilbaud · Sep 8, 2023 The answer has been given in French here by @Lorenzo Scalese You can create a custom class query like this: Class dc.Frank { Query QueryAFO() As %Query(ROWSPEC = "key1:%String,key2:%String,key3:%String,key4:%String,key5:%String,key6:%String,datavalue:%String") [ SqlProc ] { } ClassMethod QueryAFOExecute(ByRef qHandle As %Binary) As %Status { Set qHandle("node") = $Name(^AFO) Quit $$$OK } ClassMethod QueryAFOFetch( ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Boolean) As %Status [ PlaceAfter = QueryAFOExecute ] { Set sc = $$$OK Set qHandle("node") = $Query(@qHandle("node"), 1, data) If qHandle("node") = "" Set Row = "", AtEnd = $$$YES Quit $$$OK ; feeds the key x fields based on the subscripts of the global For i=1:1:$QLength(qHandle("node")) Set $List(Row, i) = $QSubscript(qHandle("node"), i) If i < 6 { ; if we do not have 6 subscripts, we feed the rest with an empty string For j = i+1:1:6 Set $List(Row, j) = "" } Set $List(Row, 7) = data, AtEnd = $$$NO Quit sc } ClassMethod QueryAFOClose(ByRef qHandle As %Binary) As %Status [ PlaceAfter = QueryAFOExecute ] { Kill qHandle Quit $$$OK } /// just for some test data ClassMethod set() { s ^AFO("Site","Ville")="66722,3743" s ^AFO("Site","Ville","111BB","OBT")=",MMM,XXX," s ^AFO("Site","Ville","111OW","OBT")=",XXX,MMM," s ^AFO("Site","Ville","AANVRBIBS","zzz") = "1^^1" s ^AFO("Site","Ville","AANVRBIBS","zzz","*","dut") = "*afhalen waar gevonden" s ^AFO("Site","Ville","AANVRBIBS","zzz","*","eng") = "*Pickup where found" s ^AFO("Site","Ville","AANVRBIBS","zzz","*","fre") = "*Lieu où trouvé" } } You can then easily exploit it with the following query: select * from dc.Frank_QueryAFO() In terminal mode, you can also simply use this line to display the results: Do ##class(dc.Frank).QueryAFOFunc().%Display() For my part, I carried out the test on IRIS 2023.2, there should be no incompatibility, but if you notice a problem do not hesitate to respond with the error message.
go to post Sylvain Guilbaud · Aug 31, 2023 Hi @Anup Thakkar, the simplest way to always stay in the current century is : $ZDATEH("05/26/23",,,6) You just need to use year-opt = 6 to get all dates with two-digit years in the current century . w $zdt($ZDATEH("05/26/23",,,6),3) 2023-05-26 w $zdt($ZDATEH("05/26/1923",,,6),3) 1923-05-26
go to post Sylvain Guilbaud · Aug 30, 2023 To activate all system AUDIT events, simply execute the following SQL query from the namespace %SYS : update security.events set enabled=1 where flags = 1 example : set tRes = ##class(%SQL.Statement).%ExecDirect(,"update security.events set enabled=1 where flags = 1") if tRes.%SQLCODE=0 { set ^["USER"]TRACE("%SYS Security.Events")=tRes.%ROWCOUNT_" successfully enabled" } else { set ^["USER"]TRACE("%SYS Security.Events")=tRes.%Message_" SQLCODE:"_tRes.%SQLCODE }
go to post Sylvain Guilbaud · Aug 29, 2023 Good to know.I had no idea of this quite combersome workflow with the information in this thread of discussion.Maybe some other Python libraries could be of help here.
go to post Sylvain Guilbaud · Aug 29, 2023 Now with embedded Python, you can have a quite simple code using pandas : /// Convert an Excel file to a CSV file ClassMethod XLStoCSV(source As %String = "/data/sample.xlsx") As %Status [ Language = python ] { import pandas as pd read_file = pd.read_excel(source) read_file.to_csv(source+'.csv', index = None, header=True) }
go to post Sylvain Guilbaud · Aug 28, 2023 Actually excluding all the "%" schemas in the connection setting is not working properly as it masks all the schemas' names. You have directly the names of all the tables and when you try to open it, you get an error as the query use SQLUser as the default schema.
go to post Sylvain Guilbaud · Aug 28, 2023 I agree.Filtering "schemas / users" by excluding "%" it not working very well indeed as it masks all the schemas' names and then considers all the tables in the "SQLUser" default schema...
go to post Sylvain Guilbaud · Aug 28, 2023 The solution is to use the Schemas / Users filters in the connection settings : And adding "%" in the "to exclude" part :
go to post Sylvain Guilbaud · Oct 4, 2022 Hi @Joel Espinoza, Kong provides an open source configuration management tool (written in Go), called decK (which stands for declarative Kong). You'll find more information here.
go to post Sylvain Guilbaud · Feb 28, 2022 docker exec -ti -u root sam-prometheus-1 sh /prometheus # wget http://172.20.10.3:50004/api/monitor/metrics -O iris-a-metrics Connecting to 172.20.10.3:50004 (172.20.10.3:50004) saving to 'iris-a-metrics' iris-a-metrics 100% |*************************************************************************************************| 8584 0:00:00 ETA 'iris-a-metrics' saved /prometheus # wget http://172.20.10.3:50014/api/monitor/metrics -O iris-b-metrics Connecting to 172.20.10.3:50014 (172.20.10.3:50014) saving to 'iris-b-metrics' iris-b-metrics 100% |*************************************************************************************************| 7901 0:00:00 ETA 'iris-b-metrics' saved /prometheus # wget http://172.20.10.3:52773/api/monitor/metrics -O iris-health-metrics Connecting to 172.20.10.3:52773 (172.20.10.3:52773) saving to 'iris-health-metrics' iris-health-metrics 100% |*************************************************************************************************| 24567 0:00:00 ETA 'iris-health-metrics' saved /prometheus # wget http://172.20.10.3:52774/api/monitor/metrics -O iris-metrics Connecting to 172.20.10.3:52774 (172.20.10.3:52774) saving to 'iris-metrics' iris-metrics 100% |*************************************************************************************************| 6110 0:00:00 ETA 'iris-metrics' saved