go to post Eduard Lebedyuk · Feb 8, 2023 Can you provide a minimal disp/impl/spec classes example please?
go to post Eduard Lebedyuk · Feb 6, 2023 Pythonic way is to use with. In that case close is automatic as soon as we get outsude of the context: ClassMethod ReadFileUsingPython(pFile As %String) [ Language = python ] { from datetime import datetime import iris time1 = datetime.timestamp(datetime.now()) print(time1) if pFile=="": raise Exception("filename is required.") with open(pFile,"r", encoding="utf-8", errors="ignore") as file: log = iris.cls('otw.log.Log') for line in file: status = log.ImportLine(line) time2 = datetime.timestamp(datetime.now()) print(time2) print("Execution time: ",(time2-time1)) }
go to post Eduard Lebedyuk · Feb 5, 2023 Also you can simplify your code: ClassMethod ReadFileUsingPython(pFile As %String) [ Language = python ] { from datetime import datetime import iris time1 = datetime.timestamp(datetime.now()) print(time1) if pFile=="": raise Exception("filename is required.") file = open(pFile,"r", encoding="utf-8", errors="ignore") log = iris.cls('otw.log.Log') for line in file: status = log.ImportLine(line) time2 = datetime.timestamp(datetime.now()) print(time2) print("Execution time: ",(time2-time1)) }
go to post Eduard Lebedyuk · Feb 5, 2023 Try to open your file like this: file = open(pFile, "r", encoding="utf-8", errors="ignore") Docs.
go to post Eduard Lebedyuk · Feb 3, 2023 Download Caché 2018.1.7 from the WRC - it will be able to mount CACHE.DAT from Caché 2012.1 or restore a backup from it.
go to post Eduard Lebedyuk · Feb 2, 2023 Do you have this line: <!-- Get info about pivot variables--> <Route Url="/PivotVariables/:Cube" Method="GET" Call="WritePivotVariablesForCube"/> in the UrlMap of the MDX2JSON.REST class?
go to post Eduard Lebedyuk · Jan 27, 2023 Interrupt causes rollback, try this code: Class User.Del Extends (%Persistent, %Populate) [ Final ] { ClassMethod HangBool(seconds, id) As %Boolean [ SqlProc ] { hang seconds quit $$$YES } /// do ##class(User.Del).Test() ClassMethod Test() { do ..%KillExtent() do ..Populate(10,,,,$$$NO) set start = $zh &sql(DELETE FROM Del WHERE Del_HangBool(1, id)=1) set end = $zh w "Delete took: ", end-start,! } } Regardless of when you send the interrupt, the ^User.DelD global would have 10 records.
go to post Eduard Lebedyuk · Jan 27, 2023 I don't think it's possible. You can suspend the process, manually delete locks, run other tasks, and unsuspend the process. But that's definitely not a supported practice.
go to post Eduard Lebedyuk · Jan 27, 2023 For cross-namespace queries the easiest way is to map packages/globals but that might not be a recommended approach for an audit table. You can do this: In your production namespace create a new table with the same structure as your audit select query backed by PPG storage. Switch to the audit namespace. Run audit query, iterate the results and write them into the PPG. Switch into a production namespace. Run query against your PPG table, joining any local tables.
go to post Eduard Lebedyuk · Jan 26, 2023 Audit event has a namespace property, filter by that. Same for timestamp, audit event timestamp and production class compilation timestamp are probably close to each other.
go to post Eduard Lebedyuk · Jan 26, 2023 Enable %Ensemble/%Production/ModifyConfiguration in System Audit Events: After that you should see these events:
go to post Eduard Lebedyuk · Jan 26, 2023 Audit table contains all production item changes you can query it once every X minutes/hours to get new changes.
go to post Eduard Lebedyuk · Jan 26, 2023 %objlasterror is %Status which is a binary format. You can store it in a property of a %Status type and use ODBC mode for SQL queries, or use $system.Status.DisplayError(sc) to get/store the display value.
go to post Eduard Lebedyuk · Jan 25, 2023 Try to export the project with one deployed class. Open exported xml and check if the class is there and deployed.
go to post Eduard Lebedyuk · Jan 25, 2023 No, should be the same. Do you see (deployed) classes in Studio/VSCode?
go to post Eduard Lebedyuk · Jan 25, 2023 Use args... to supply a variable number of parameters: ClassMethod DoCleverStuf(args...) As %Status [ CodeMode = objectgenerator ] { do %code.WriteLine(" For i=1:1:args {") do %code.WriteLine(" Write args(i)") do %code.WriteLine(" }") do %code.WriteLine(" Set tSC = $$$OK") ... } can I generate a whole method at compile time? You can use projections to do that. Here's an example.