go to post Eduard Lebedyuk · Nov 13, 2019 You can change the charset by setting this global: set ^%SYS("CSP","DefaultFileCharset")="utf-8"
go to post Eduard Lebedyuk · Nov 10, 2019 Do you want for each Movie object (row) to guarantee that it's Actors property would be unique (containing only distinct Actors)? Or is it something else? Can you show us examples of correct and incorrect Movie records?
go to post Eduard Lebedyuk · Nov 7, 2019 Some questions/notes: 1. Why are you not using relationships? 2. If you have an object, which references another object in a property and you save a base object all it's properties-objects are also saved automatically. Have you thought about setting all references before save and after that only calling %Save() once? 3. I'd really recommend against relying on auto-incremental ID matches. They are NOT guaranteed to be equal. 4. The answer to your original question depends on where the failure was. %OnAfterSave is in transaction and is rolled back. However $Increment used to get hew IDs is not rolled back (as per documentation).
go to post Eduard Lebedyuk · Nov 5, 2019 If you want it stored, make it triggered computed like this: Property LabCode As %Library.String(MAXLEN = 64) [ SqlColumnNumber = 5, SqlComputeCode = { set {*}= $EXTRACT({LabName},0,3)_" "_{LabID}}, SqlComputed, SqlComputeOnChange = LabName ]; Docs. Note that it wouldn't recalc LabCode values for existing rows. If you need that, trigger recalculation with trivial update.
go to post Eduard Lebedyuk · Nov 5, 2019 Use {%%ID}. Here's an example: Class util.Calc Extends %Persistent { Property calc As %String [ Calculated, SqlComputeCode = {set {*} = {%%ID}}, SqlComputed ]; /// do ##class(util.Calc).Test() ClassMethod Test() { set obj = ..%New() set sc = obj.%Save() do ..AllFunc().%Display() } Query All() As %SQLQuery { SELECT * FROM util.Calc } } Calling: do ##class(util.Calc).Test() Returns: ID calc 1 1 Docs.
go to post Eduard Lebedyuk · Nov 4, 2019 That would work storagetime but not at runtime. I think runtime hook disallowing duplicate inserts would be better. To OP. Age seems like a strange property to store in your use case. It's better to store DoB I think.
go to post Eduard Lebedyuk · Nov 1, 2019 There are many ways to do what you need. Copy CACHE.DAT / IRIS.DAT Export globals and code Use ASYNC mirror or backup Here's the questions you need to answer to choose the best path: Is downtime OK or not? Do you need a whole database or some part? What's the size of your DB? Are there mirrors/backups available? Are your code/data in separate DBs? Do you need to run the pipeline once or do you need to stay somewhat up to date?
go to post Eduard Lebedyuk · Oct 30, 2019 Some info about upcoming AI/ML webinar. Only a week left to register!
go to post Eduard Lebedyuk · Oct 28, 2019 What value are you expecting? Base64 is often used to encode hashes: write ##class(%SYSTEM.Encryption).Base64Encode(##class(%SYSTEM.Encryption).MD5Hash("f...@baz.com"))
go to post Eduard Lebedyuk · Oct 25, 2019 You need to create a class, for example. Test.EnsUtils, in it add this class method. After that execute the query above (name of the sql procedure would be Test.EnsUtils_ItemStatuses)
go to post Eduard Lebedyuk · Oct 24, 2019 You'll need a SQL procedure to return status. I haven't found it already SQL enabled. ClassMethod ItemStatuses(pName, pIsRunning, pEnabled, pID) As %String [ CodeMode = expression, SqlProc ] { ##class(EnsPortal.Utils).ItemStatuses(pName, pIsRunning, pEnabled, pID) } After that just query Ens_Config.Item: SELECT ID, ClassName, Name, Enabled, ItemStatuses(Name, 1, Enabled, Id) Status FROM Ens_Config.Item Parameter pIsRunning means a running production. Procedure returns comma-separated info about host status and io status.
go to post Eduard Lebedyuk · Oct 23, 2019 What error are you getting? The part of the code you've shown looks correct, except you don't need to call $zcvt, %Net.HttpRequest does that for you..
go to post Eduard Lebedyuk · Oct 19, 2019 Do you use an alternative or framework built around this native Unit Testing tool ? Not really. What is your experience with %UnitTest if you use it ? Except lack of test parallelization it's actually quite good. Also would be great to be able to skip some tests natively. Is there a tool you would recommend for your UI (I know this is not specifically an InterSystems' related question) @Sergey.Sarkisyan any comments? What process do you use to routinely run tests on your application ? You can read about that in my series of articles on GitLab.