Hi Community!

We want to invite you to join the InterSystems Gamification Platform called Global Masters Advocate Hub!

The Global Masters Advocacy Hub is our customer engagement platform where you will be invited to have some fun completing entertaining challenges, earning badges for the contribution to Developer Community, communicating with other advocates, and accumulating points which you can redeem for a variety of rewards and special honors.

7 123
3 4.7K
Article
· May 31, 2017 28m read
Cogs Library

Cogs Library

Over the next few months I will be releasing a number of open source libraries and tools to the Caché community.

Most of the code has evolved from previous production grade solutions over the years and I am collating it together under a single overarching library package that I am calling Cogs.

17 38
4 1.4K
Article
· Jul 18, 2017 2m read
Old/New Dynamic SQL Cheat Sheet

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:

8 35
4 2.2K
Announcement
· Jan 19, 2017
Caché WebTerminal v4 Release

Greetings, InterSystems community!

I am pleased to announce that the web terminal project, Caché WebTerminal version 4 gets its release! After long period of enhancing this web application from 2013, it came to the version 4, which features major stability and security improvements, intelligent autocomplete and syntax highlighting, convenient SQL mode and a lot of other useful features.

The goal of this article is to spread the knowledge about this project over the InterSystems community.

16 34
2 3.4K
Question
· Aug 25, 2017
Runtime type detection

SOLVED

tl;dr how can you tell if a number is really a string

The original question has been updated/improved.

Equality comparisons on floating point numbers will produce different results...

"1.1"=1.1 //is true!

"0.1"=0.1 //is not true :(

This second comparison can be fixed with...

+"0.1"=+0.1 // is true!

0 31
0 1.1K

The DeclarativeCOS project is a heartfelt cry about programming in the COS language.

The purpose of the project is to draw attention of the public to improving the inner core of COS.

The idea of the project is the support of a laconic syntax for cycles and collections.

So what is this laconic something that I have come up with? Welcome to the examples below!

Examples

The key concept underlying the project is the declarative approach to writing code. You need to specify WHAT should be used and HOW.

7 31
0 1.7K

I would like to start a discussion regarding Caché Objects and Caché SQL.

It is my understanding that the creators of Caché Objects see Caché SQL as the reporting arm of Objects and as such SQL is essential to Caché Objects.

I once met a Caché Objects programmer who was writing code to $Order through the Globals because that person thought that Caché SQL was too slow and inefficient. I attempted to convince the person otherwise.

So, what say you? Is SQL essential to Caché Objects?

Or

0 29
0 796

I have a query string that I am creating programmatically, based on some user inputs. The user might search on 5 fields, or 8 fields, or no fields.

In my sql statment, some of these fields require parameters in the %Execute statement.

For example:

if user picks lastname, sql = "select * from person where lastname = ?"

if user also picks age, sql = "select * from person where lastname=? and age > ?"

I then have these lines of code to create my result set:

set statement = %SQL.Statement

statement.%Prepare

0 28
0 22K

The dataCombo property columnHeaders is a comma-delimited list of column headers displayed in the dropdown list.

Comma is a delimiter.

But, if I want add comma to columh header, for instance "House number, apartment" - this is value for header of one column.

How can I escape comma in this case?

"House number\, apartment" - is not working.

0 26
0 499

Hi, folks!

Suppose you have a Caché class with %String property which contains relatively large text (from 10 to 2000 symbols).

The class:

Class Test.Duplicates Extends %Persistent 

{

Property Text As %String (MAXLEN = 2000);

}

And you have thousands of entries.

What are the best options to find entries which are duplicates on this property?

0 26
1 1.3K

I am experimenting with Relationships, both Parent to Child and One to Many.

I have done some SQL look-ups and have searched through the documentation, however not in a lot detail, but wonder if there are more and better ways to access both sides of Relationships through SQL?

Thank you in advance for any help provided.

1 25
0 1.9K

I'm aware of two ways to get list of files in a dir:

set dir = "C:\temp\"
set rs = ##class(%File).FileSetFunc(dir, , , 1)
do rs.%Display()

and:

set dir = "C:\temp\"
set file=$ZSEARCH(dir_"*")
while file'="" {
   write !,file
   set file=$ZSEARCH("")
}

Yet they bot return only files and directories in a current directory, but not files in subdirectories.

I suppose I call one of these recursively, but maybe there's a better solution?

1 25
1 3.6K

Hi, this post was initially written for Caché. In June 2023, I finally updated it for IRIS. If you are revisiting the post since then, the only real change is substituting Caché for IRIS! I also updated the links for IRIS documentation and fixed a few typos and grammatical errors. Enjoy :)

19 24
5 10.3K

On the back of my recent post on writing bug-less code I wanted to raise a few suggestions (to ISC) that would help prevent certain types of bugs at compile time. I've probably missed a few, but these are the main ones in my mind. Please contribute more suggestions.

Btw, these also serve as potential gotchas for new COS developers.

4 24
0 1K
Question
· Jul 18, 2017
how to release memory for process?

hi

I query large mount of rows from one table with JDBC, and will prompt <store> error. I found that it was out of process memory (default 16M, max 49M in version 2010.2) .

so my question is : how to release memory for large mount of rows query? or how to resolve this error?

0 24
0 772
This is the second part of my long post about package managers in operating systems and language distributions. Now, hopefully, we have managed to convince you that convenient package manager and rich 3rd party code repository is one key factor in establishing of a vibrant and fast growing ecosystem. (Another possible reason for ecosystem success is the consistent language design, but it will be topic for another day.)
6 23
1 1.3K

So, one day you're working away at WidgetsDirect, the leading supplier of widget and widget accessories, when your boss asks you to develop the new customer facing portal to allow the client base to access the next generation of Widgets..... and he wants you to use Angular 1.x to read into the department's Caché server.

There's only one problem: You've never used Angular, and don't know how to make it talk to Caché.

This guide is going to walk through the process of setting up a full Angular stack which communicates with a Caché backend using JSON over REST.

16 23
3 4.7K

I have classes A and B, B derived from A, A has method Abc.

From INT of class B I see that compiler copies implementation of Abc to class B, so that Abc exists both in A and B.

As result, when B invokes Abs, B.Abs() is executed instead of A.Abs(). In result debuger is not able to step into Abs and breakpoints in A.Abs never hit.

Why this happens and how can I avoid this?

Update:

OK, now I know the reason: compiler makes the copy if Abc has this line:

0 21
0 391

I'm looking at adding multilingual support to a couple of open source projects I'm working on. The solutions are already developed in CSP so I am not looking for alternative approaches.

I'm wondering what would be the best approach for CSP and separate JavaScript files.

Initially I was wondering if I should bake the default system language text at compile time, or provide the end user with a language selection option at run time.

I came across $$$TEXT reading the docs...

1 20
0 495
Question
· Jul 23, 2017
Check if class exists

There is method:

$System.OBJ.New( ClassName As %String = "" )

If class with name ClassName exists - everything is OK.

But, when class does not exist, there is error - <CLASS DOES NOT EXIST>

How can I check before calling $System.OBJ.New() if class witn name ClassName exists?

0 19
0 3.8K

Hi,

I am wondering if there is a way I can change the GUID of an instance. The use case is that I am restoring from a backup on an alternate host and start the instance there. However, the restored instance ends up with same GUID as that of source. Is there a way I can tell this newly restored instance to use a different GUID?

Thanks,

Raghu

0 19
0 690

image

The InterSystems DBMS has a built-in technology for working with non-structured data called iKnow and a full-text search technology called iFind. We decided to take a dive into both and make something useful. As the result, we have DocSearch — a web application for searching in InterSystems documentation using iKnow and iFind.

8 18
0 1.4K
Article
· Apr 12, 2017 5m read
Bug killing development tips

Does anyone NOT use a debugger? I can't remember the last time I did. It's not because I don't dislike them, I just don't need to use them. The main reason for this is because I have a certain development methodology that either produces less bugs, catches them at a unit test level, or makes tracking them down much easier.

Here are my tips...

1. Write your own COS cheat-sheet.

19 17
6 1.5K