go to post Eduard Lebedyuk · Jul 30, 2019 E=D should work.You don't need to throw an exception, just return error %Status from handler method.
go to post Eduard Lebedyuk · Jul 29, 2019 The problem with JSON_OBJECT is that you need to write each field twice for each query.It's good for one-off things, but for generalized solution authors approach looks better.
go to post Eduard Lebedyuk · Jul 29, 2019 I use Pycharm for complicated projects and debugging and bash for quick scripting.Also check PythonGateway - it comes with integrated Python interpreter right in your IRIS terminal.
go to post Eduard Lebedyuk · Jul 29, 2019 If you don't need statistics, this should help kill ^rINDEXSQL("sqlidx") or with macros kill $$$SQLIndexRoot Untested but should help. Maybe backup the global just in case.
go to post Eduard Lebedyuk · Jul 27, 2019 Tip.Metadata does not change from one row to the other and accessing it takes time, so removing it from the row loop would improve the execution speed: Class User.Test { Query TestQuery() As %SQLQuery { SELECT * FROM Sample.Person } /// do ##class(User.Test).Test() ClassMethod Test() { for method = "EveryRow", "Once" { set rSet = ..TestQueryFunc() set start = $zh do $classmethod(, method, rSet) set end = $zh write $$$FormatText("Method %1 took %2 sec.", method, end - start), ! } } ClassMethod EveryRow(rSet As %SQL.ISelectResult) { set tResults = [] while rSet.%Next() { set tRow = {} set tMetadata = rSet.%GetMetadata() set tColumnCount = tMetadata.columns.Count() for x=1:1:tColumnCount { set tColumn = tMetadata.columns.GetAt(x) set tColumnName = tColumn.colName //do tRow.%Set(tColumnName, rSet.%GetData(x) ) set $PROPERTY(tRow,tColumnName) = $PROPERTY(rSet,tColumnName) } do tResults.%Push(tRow) } } ClassMethod Once(rSet As %SQL.ISelectResult) { set tResults = [] set tColumns = "" set tMetadata = rSet.%GetMetadata() set tColumnCount = tMetadata.columns.Count() for x=1:1:tColumnCount { set tColumn = tMetadata.columns.GetAt(x) set tColumnName = tColumn.colName set tColumns = tColumns _ $lb(tColumnName) } while rSet.%Next() { set tRow = {} for x=1:1:tColumnCount { do tRow.%Set($lg(tColumns, x), rSet.%GetData(x) ) } do tResults.%Push(tRow) } } } Results for me: >do ##class(User.Test).Test() Method EveryRow took .017803 sec. Method Once took .01076 sec.
go to post Eduard Lebedyuk · Jul 25, 2019 By default Ensemble service is run under System account, which does not have user environment variables.You can either specify system variables or run Ensemble service from a user account.
go to post Eduard Lebedyuk · Jul 21, 2019 This really helps when you have several running containers simultaneously and don't know what port of Management Portal relates to a certain terminal.Wouldn't help, as terminals would report internal container port, which is always 52773.
go to post Eduard Lebedyuk · Jul 20, 2019 For general approaches check Debugging Web articles: Part 1, Part 2.
go to post Eduard Lebedyuk · Jul 19, 2019 Check this post to see how you can access all levels of dynamic object.
go to post Eduard Lebedyuk · Jul 18, 2019 I suggest you contact the WRC for this problem.I think the problem is in the command escaping.
go to post Eduard Lebedyuk · Jul 18, 2019 Try C:\InterSystems\Cache\bin\cache.exe -s C:\InterSystems\Cache\mgr -U %%SYS C:\Users\Zdenda\Desktop\run.script
go to post Eduard Lebedyuk · Jul 18, 2019 Well, show your cmd script (as text) and ObjectScript script.
go to post Eduard Lebedyuk · Jul 18, 2019 ObjectScript script I guess. Just a file with ObjectScript commands.Here's a sample.
go to post Eduard Lebedyuk · Jul 18, 2019 You need to either escape your command or use a separate file for a script. I recommend a file.
go to post Eduard Lebedyuk · Jul 18, 2019 I've got minimal security settingsThen you don't need to provide user and password. I can use this method right Login(Username As %String, Password As %String)?No. First line of script - user, second line - password. After that - ObjectScript.Do $system.OBJ.Load("Installer.xml", "c") I dont know why. Try full path. Also this method returns status, check it: Set sc = $system.OBJ.Load("/path/to/Installer.xml", "c") Write:('sc) $System.Status.GetErrorText(sc)
go to post Eduard Lebedyuk · Jul 18, 2019 First two lines of your script should probably be user and password, unless you're running a minimal security install or enabled OS authentication.ObjectScript code after that, yes, sothis looks correct do ##class(User.Installer).setup() Maybe you need to load User.Installer beforehand? Use $system.OBJ.Load(file, "c") to load and compile class(es) you need.