go to post Stephen Canzano · Nov 9, 2023 In this case I think tSC represents a status that indicates was the HttpRequest able to reach the remote server, not specifically what the call successful or not and yes http.HttpResponse.StatusCode will have values of 200 401 404 500 etc.
go to post Stephen Canzano · Oct 18, 2023 Not sure of your specific question but I have always considered having ReportDefinition not sort the data but instead implement ordering as part of the ReportDisplay when using a <table>. orderby in a table performs an xsl sort and feel like it's the better place to perform this so that I'm not asking the database to perform the ordering.
go to post Stephen Canzano · Aug 30, 2023 I almost never use the %On... methods as they are only called via object interaction if I want to handle the SQL interaction I have to write the code a second time as Wolf suggests a properly defined trigger with Foreach=row/object will be called during both Object and SQL interaction which means I can write one set of code to handle both and I find for this scenario it's best to think "SQL" instead of objects.
go to post Stephen Canzano · Aug 17, 2023 The attached class should provide what you are looking for based on my testing. This follows work I did while at a prior position. Some things to note about this class I'm declaring SqlRowIdName = Id so that I don't end up with an Id1 column in the SQL view of the table I've set Parameter STORAGEDELIMITERCHECK = 1; so that when an Save/Insert/Update is done it ensures that the data fields do not contain a delimiter and then "throw off" the piecing strategy, if you aren using delimited data but instead using $list data then you wouldn't need this. I've overridden %OnNew so as to establish an array of namespaces where the data lives You would also want to call SetServerInitCode in %SYSTEM.SQL or the corresponding SetOption in %SYSTEM.SQL.Util so as to build up the namespaces array. My usage of the namespaces array is for demonstration purposes only, your application probably already has some array that defines where the CB global is defined. If you want to only provide read access thru objects and SQL you could set the class Parameter READONLY=1; seems like uploading a file doesn't work.. here's the class definition .. this will work on Cache or IRIS although on a Cache based system you would have to change <Type>%Storage.SQL</Type> to the proper Cache type. Class Mapping.Test1 Extends %Persistent [ SqlRowIdName = Id, StorageStrategy = SQLStorage ] { /// Namespace Property NS As %String [ Required ]; /// Contact Row ID Property RowID As %Library.String(SELECTIVITY = 1, TRUNCATE = 1) [ Required ]; Property Field1 As %String; Property Field2 As %String; Index RowIDBasedIDKeyIndex On (NS, RowID) [ IdKey ]; /// <Example> /// Set tSC=##class(Mappting.Test1).Populate() /// </example> ClassMethod Populate() As %Status { #dim tSC As %Status=$$$OK #dim eException As %Exception.AbstractException try { Set tObject=..%New() Set tObject.NS="LAB" Set tObject.RowID=1 $$$THROWONERROR(tSC,tObject.%Save()) Write !,tObject.NS,": ",tObject.RowID Set tObject=..%New() Set tObject.NS="ARK" Set tObject.RowID=1 $$$THROWONERROR(tSC,tObject.%Save()) Write !,tObject.NS,": ",tObject.RowID &SQL(insert into Mapping.Test1 (NS,Rowid) values ('LAB',2)) If SQLCODE $$$ThrowStatus(##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE,%msg)) } catch eException { Set tSC=eException.AsStatus() } Quit tSC } Storage SQLStorage { <SQLMap name="Map1"> <Data name="Field1"> <Delimiter>"^"</Delimiter> <Piece>1</Piece> </Data> <Data name="Field2"> <Delimiter>"^"</Delimiter> <Piece>2</Piece> </Data> <Global>namespaces</Global> <Subscript name="1"> <Expression>{NS}</Expression> </Subscript> <Subscript name="2"> <Expression>1</Expression> </Subscript> <Subscript name="3"> <DataAccess>^[{L1}]CB({L2})</DataAccess> <Expression>{RowID}</Expression> </Subscript> <Type>data</Type> </SQLMap> <StreamLocation>^Mappting.Test1S</StreamLocation> <Type>%Storage.SQL</Type> } /// This callback method is invoked by the <METHOD>%New</METHOD> method to /// provide notification that a new instance of an object is being created. /// /// <P>If this method returns an error then the object will not be created. /// <p>It is passed the arguments provided in the %New call. /// When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). /// For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be: /// <p>Method %OnNew(dob as %Date = "", name as %Name = "") as %Status /// If instead of returning a %Status code this returns an oref and this oref is a subclass of the current /// class then this oref will be the one returned to the caller of %New method. Method %OnNew() As %Status [ Private, PublicList = namespaces, ServerOnly = 1 ] { #dim tSC As %Status=$$$OK #dim eException As %Exception.AbstractException Try { Set namespaces("LAB")="" Set namespaces("ARK")="" } Catch eException { Set tSC=eException.AsStatus() } Quit tSC } Parameter STORAGEDELIMITERCHECK = 1; }
go to post Stephen Canzano · Jul 7, 2023 I commonly will use COALESCE in my SQL statements when I want to define an default value, as an example I would do SELECT COALESCE(Amount,0.00)
go to post Stephen Canzano · Jun 21, 2023 If you are describing your globals in a class and they do not use default storage, but rather SQL Storage(%Storage.SQL) you can define your storage to include extended references. This is a technique that I have used in the past. How you loop thru the extended references is up to you. In my case we took advantage of the ability to SetServerInitCode which is called once when the connection is made to the server, there is an equivalent capability in DeepSee/Analytics. In our ServerInitCode we populated an array of the different extended references we needed to access and our storage map firstly looped thru this structure and then the actual global.
go to post Stephen Canzano · May 26, 2023 My only comment is that I always add to the Execute, Fetch and Close methods that decorator [Internal] so as to not pollute the class documentation in Documatic. These methods while class methods would never actually be called independently of the Class query, or I cant see a good case for where that would be true.
go to post Stephen Canzano · May 25, 2023 and I could be incorrect as I don't speak for InterSystems but I read this message as %ZEN.Report* won't be included in standard ISC kits in the future, ie the kits will be slightly smaller. You can always get this code using IPM As reported in the past, ZEN Reports are deprecated which means no more enhancements, maybe even means no bug fixes. Maybe(my guess) this means at some point %ZEN.Report* will become open sourced and we can contribute where needed... but again that's purely a guess. I'm a big user/developer of ZEN Reports and it is important that I still have the ability to utilize ZEN Reports. At the same time, it just might be the time to look at what LogiReport offers and see if it's on the whole, a better reporting environment.
go to post Stephen Canzano · May 17, 2023 and just today spotted https://blog.postman.com/introducing-the-postman-vs-code-extension/ . This isn't full formed as they report We will continuously ship features and improvements—such as support for Postman Collections and environments—so be on the lookout. We value your input, so if you have any feedback on this beta version, please feel free to leave it in the comments. but just one more example why measured on the whole VS Code really is a better environment IMHO.
go to post Stephen Canzano · May 17, 2023 some context about me.. I've been working with InterSystems technologies since 1991 so I've been thru all of the changes for the past 32 years. Unless you give it a chance you won't have an opportunity to see what are the good features in VS code.
go to post Stephen Canzano · May 16, 2023 With the discussion of Intersystem IRIS Studio or VS Code, I understand the initial reaction to think you are losing something using VS Code. Will you miss some things, I'm sure you will, but measured on the whole I feel like VS Code is a much better environment even if all you ever do is objectscript work. I feel like that's the critical thing to remember, there may be some differences but measured on the whole it is better, give it a try and give it a chance, especially learning the full capabilities.
go to post Stephen Canzano · May 15, 2023 when you call the compiler did you call Set tSC=##class(%SYSTEM.OBJ).Compile(ClassName,"cuk",.errorFile) and was anything contained in the output array errorFile?
go to post Stephen Canzano · May 10, 2023 you could construct this with usage of <hgroup> and <vgroup> if you had a fixed number of rows. If you had a variable number of rows you could use a tablePane where the resultset object returns the rows with the first column being the label and the second column being the cost value for items.
go to post Stephen Canzano · Feb 24, 2023 The Athena IDX data is mapped/described by class definitions. Documatic would be a good place to start. The class definitions come with a rich set of meta-data including proper Foreign Key declarations to assist in describing the relationships between tables Example Class queries/SQL Procs which can be referenced as examples to join tables as well as other special cases. A number of SQLProces to facilitate more complex joins such as the ones founding MCA_Enrollment. Many of the tables support bitmap indices.
go to post Stephen Canzano · Feb 6, 2023 somewhat related, I commonly used in the past in IRIS Studio CRTL-G (goto) to jump to an entity within a class or routine. This dialog allow you to goto either a Line Number or Tag or Label. I wanted to be able to do the same in VS Code and found by looking at https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf in VS Code you can use CTRL-SHIFT-O. This isn't exactly your question but the link to the shortcuts is useful and for me, CTRL-SHIFT-O is what I was looking for as I wanted to jump around without using my mouse.
go to post Stephen Canzano · Jan 26, 2023 the query plan tells us that it is doing a table scan on every single row in SQLUser.Records. if er was indexed in Records it would at least use the index.,
go to post Stephen Canzano · Jan 26, 2023 Stefan is correct. Getting the query plan does 2 things It provides us your exact SQL statement It will tell us what plan is being used and if we have any table scans. My suspicion is you are missing an index on one of your tables that are included with the INNER JOIN. I imagine the number of rows for these tables are on the order of you have n number of books n *10 number of orders(as a guess) and there is a missing index on one of the Order tables but again the results of Show Plan will provide all of the information that is needed.
go to post Stephen Canzano · Dec 21, 2022 the original example(first) likely isn't the best test as all of the elements are 1 character long. My understanding is $LB data is an encoded string with the first part of the encoding containing the length of the data for an individual element. Getting the length means you can jump a number of characters to the next element. On the other hand $Piece does a character-by-character scan. ClassMethod Test() As %Status { #dim tSC As %Status=$$$OK #dim eException As %Exception.AbstractException try { set tStart=$ZH for x=1:1:1000000 { Set a=$LB("sdfdkjfdjklfdjklfdjklfds","dlkfdjklfgjklfgjklfgjklfgjkl","fdklfdsjkljklfgjkfgjkfg") Set b=$LG(a,2) } Write !,"List Duration: ",$zh-tStart set tStart=$ZH for x=1:1:1000000 { Set a="sdfdkjfdjklfdjklfdjklfds_dlkfdjklfgjklfgjklfgjklfgjkl_fdklfdsjkljklfgjkfgjkfg" Set b=$P(a,"_",2) } Write !,"Piece Duration: ",$zh-tStart set tStart=$ZH for x=1:1:1000000 { Set a=$LB("sdfdkjfdjklfdjklfdjklfds","dlkfdjklfgjklfgjklfgjklfgjkl","fdklfdsjkljklfgjkfgjkfg") Set b=$LG(a,3) } Write !,"List Duration Getting last element: ",$zh-tStart set tStart=$ZH for x=1:1:1000000 { Set a="sdfdkjfdjklfdjklfdjklfds_dlkfdjklfgjklfgjklfgjklfgjkl_fdklfdsjkljklfgjkfgjkfg" Set b=$P(a,"_",3) } Write !,"Piece Duration Geting last element: ",$zh-tStart } catch eException { Set tSC=eException.AsStatus() } Quit tSC } at the same time I'd much rather deal with $List and not have to worry about escaping delimeters.
go to post Stephen Canzano · Dec 13, 2022 Users are added via HSPI Management->Settings -> System Mode->Configuration->Assignment Username https://docs.intersystems.com/hs20222/csp/docbook/DocBook.UI.Page.cls?KE...