go to post Eduard Lebedyuk · Dec 6, 2021 Sure Property D As %String [ Calculated, SqlComputeCode = {set {*}=##class(CClass).DGetStored(##class(BClass).CGetStored(##class(ClassA).BGetStored({A})))}, SqlComputed ]; Would be way faster than SQL approach too.
go to post Eduard Lebedyuk · Dec 6, 2021 if you need to get a->b->c->d That's what chained GetStored is for! and they at the same time can be null GetStored is a safe method: GetStored("") -> "", so it can be safely used even if some values are NULL.
go to post Eduard Lebedyuk · Dec 5, 2021 Starting with 2020.1 Universal Query Cache is used for all SQL statements. Have you encountered an issue with it? Pinging @Benjamin De Boe
go to post Eduard Lebedyuk · Dec 3, 2021 Use %VarString instead of %String. It has 3.6Mb limit by default.
go to post Eduard Lebedyuk · Dec 3, 2021 You do it by chaining GetStored methods: Class Document Extends %Persistent { Property Filename As %VarString; } Class Question As %Persistent { // Or relationship Property Document As Document; Property Filename As %String [ Calculated, SqlComputeCode = {set {*}=##class(Document).FilenameGetStored({Document})}, SqlComputed ]; }
go to post Eduard Lebedyuk · Nov 25, 2021 I'm not really sure what is it that you want (please consider providing more information), but this project can be used to both read and write excel files.
go to post Eduard Lebedyuk · Nov 24, 2021 Try it like this: Class User.ResultsMessage Extends (%Persistent, %XML.Adaptor) { Property PersonIDs As list Of %String(XMLITEMNAME = "PersonID", XMLNAME = "PersonIDs", XMLPROJECTION = "WRAPPED"); XData Data { <Results> <PersonIDs> <PersonID>1000000</PersonID> <PersonID>1000001</PersonID> <PersonID>1000005</PersonID> </PersonIDs> </Results> } /// do ##class(User.ResultsMessage).Test() ClassMethod Test() { Set text = ##class(%Dictionary.XDataDefinition).IDKEYOpen($classname(), "Data").Data Set reader = ##class(%XML.Reader).%New() Set sc=reader.OpenStream(text) Do reader.Correlate("Results","User.ResultsMessage") While reader.Next(.msg,.sc) { Write !,"Count(): "_msg.PersonIDs.Count(),! } Write:$$$ISERR(sc) $System.Status.GetErrorText(sc) } } Docs.
go to post Eduard Lebedyuk · Nov 19, 2021 Have you tried connecting to this second DSN right from the start?
go to post Eduard Lebedyuk · Nov 16, 2021 Congratulations! We are almost 6 years together! Not almost - already. For example, this early post dates November 9th.
go to post Eduard Lebedyuk · Nov 14, 2021 You can use this syntax on calculated properties: /// This property holds the document state. Serialization is JSON. Property JSON As %Library.DynamicAbstractObject; /// This is an automatically calculated property "$.firstName" Property firstName As %VarString [ SqlComputeCode = { set {*}=$$%EvaluatePathOne^%DocDB.Document({JSON},"$.firstName")}, SqlComputed, SqlComputeOnChange = %Doc ]; /// Index on firstName property Index firstName On firstName;
go to post Eduard Lebedyuk · Nov 11, 2021 Well, enjoy. UPD: it was missing isc.util.dbf.Field. Class isc.util.DBF.Field Extends %SerialObject [ ClassType = serial, ProcedureBlock ] { Property name As %String(TRUNCATE = 1); Property type As %String(TRUNCATE = 1); Property length As %Integer; Property decimals As %Integer; }
go to post Eduard Lebedyuk · Nov 11, 2021 Are there really no other options (CSV, JSON, XML)? I have some code for a DBF reader, if you're interested I can share it and you can create a DBF writer by analogue.