Hi,

I'm trying to find the faster way to get the data from a class, and I find it very slow compared to traditional globals. So, I hope some of you can bring some light to me :-)

I have thousands of registers in a class, and to access it quickly I'm going with $o at the index. From there, I get the values using $listget(). Something like that:


    s FromDateH = (+$h-1)
    for {
        set id=$order(^TestI("StartDateIDX",FromDateH,id))
        quit:id=""
        set dat=$lg(^TestD(id))    //dat=$lb("a","b","c","d","e")
    }
    


I find it quite slow, so I've tried the same code but changing the conents of ^TEST from a List to a String

Last answer 7 August 2018 Last comment 9 August 2018
0   0 6
369

views

0

rating

I've been writing ObjectScript for a long time and was a little surprised by this behavior so I'd like to understand what is going on.

I was doing a peer review on some source which had roughly the equivalent of the following line:

Set myRecord = ##class(MyObj.Record).%OpenId(id)
Set emailList = previousEmails_","_myRecord.RecordGroup.EmailList

I flagged it for further testing because the code didn't check if RecordGroup was set and I knew that not all records were part of a Group so I was expecting that in cases where it wasn't set this line should throw an <INVALID OREF>

However, it turns out that I had forgotten that in the MyObj.Record class, RecordGroup is actually a one:many relationship:

Last answer 23 March 2018 Last comment 23 March 2018
0   0 3
145

views

0

rating

The newer dynamic SQL classes (%SQL.Statement and %StatementResult) perform better than %ResultSet, but I did not adopt them for some time because I had learned how to use %ResultSet. Finally, I made a cheat sheet, which I find useful when writing new code or rewriting old code. I thought other people might find it useful.

First, here is a somewhat more verbose adaptation of my cheat sheet

Last comment 18 October 2017
+ 7   1 12
1252

views

+ 7

rating

I am inserting rows in a table. This table is appearing in all namespace as I did global mapping. 

So once I run insert command from a method, it insert the rows. When I run the same insert command from other namespace, it replace the existing data in table. 

Insert command is same in all namespace but the data I m inserting is different. 

 

Last answer 30 May 2017
0   0 3
0

comments

233

views

0

rating

Hello All,

I have a question / issue regarding the calling list.FindOref(<object from indexOpen call>)
Here is a simple way to reproduce the issue: 
2 classes: Utility.contacttypes and Utility.person
*************************

Class Utility.contacttypes Extends %Persistent
{
Property description As %Library.String(TRUNCATE = 1);
/// Index for property description
Index descriptionIndex On description [ Unique ];
}

************************

Last answer 12 May 2017 Last comment 12 May 2017
+ 3   0 5
183

views

+ 3

rating

Hi!

We updated the DC a bit.

Member's answers

With this release, you can see the answers on the member's page too.

E.g. see the answers by Timothy Leavitt

Post updates don't move the post to top

So we can fix the tags, spelling and make other updates to the post and it would not be moved to top anymore. 

Now only new answers and comments move the post to the top of the feed.

RSS and other bug fixes

Now bugs for RSS feeds are fixed.

Also, Votes renamed to Rating and has the color indication now. Green means good!

Stay tuned for the next DC improvements!

Last comment 2 December 2016
+ 2   0 1
108

views

+ 2

rating

NewBie's Corner Session 28 Various Methods to Traverse a Global

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

Judging from the number of responses to Session 27 Traversing A Global, developers are passionate about their methods. I am not here to judge the merit of the various methods.

Over the next few pages I will demonstrate a number of methods to Traverse a Global. If you don't already have a favorite they may help you pick one.

I will repeat the method from Session 27 just to have all methods in one post.

There may be variations on these methods and perhaps methods I am not aware of. Feel free to chime in and express your opinion, that is how we all learn.

If you use Caché Objects and Methods with Caché SQL you should never have to worry about traversing a Global, that is the best to my way of thinking

Last comment 4 October 2016
+ 2   0 8
444

views

+ 2

rating

Is there any update on when the RSS feed will be fixed to finally include a Title field. This was reported about 5 months ago. Specifically:

 

The RSS feed for groups (or communities as the link currently says) does not include a title, e.g. for:

https://community.intersystems.com/group/8081/feed

Starts with:

    <title></title>
    <link>https://community.intersystems.com/group/8081</link>
    <description></description>

So there is no title or description of this feed. Also is there a feed for all content posted to this site, so not filtered by tag/group at all?

Last answer 4 September 2016
0   0 1
0

comments

98

views

0

rating