InterSystems Developer Community is a community of 16,273 amazing developers
We're a place where InterSystems IRIS programmers learn and share, stay up-to-date, grow together and have fun!

Let me introduce my new project, which is irissqlcli, REPL (Read-Eval-Print Loop) for InterSystems IRIS SQL

  • Syntax Highlighting
  • Suggestions (tables, functions)
  • 20+ output formats
  • stdin support
  • Output to files

Install it with pip

pip install irissqlcli

Or run with docker

docker run -it caretdev/irissqlcli irissqlcli iris://_SYSTEM:SYS@host.docker.internal:1972/USER

Connect to IRIS

$ irissqlcli iris://_SYSTEM@localhost:1972/USER -W
Password for _SYSTEM:
Server:  InterSystems IRIS Version 2022.3.0.606 xDBC Protocol Version 65
Version: 0.1.0
[SQL]_SYSTEM@localhost:USER> select $ZVERSION
| Expression_1                                                                                            |
| IRIS for UNIX (Ubuntu Server LTS for ARM64 Containers) 2022.3 (Build 606U) Mon Jan 30 2023 09:05:12 EST |
1 row in set
Time: 0.063s
[SQL]_SYSTEM@localhost:USER> help
| Command  | Shortcut          | Description                                                |
| .exit    | \q                | Exit.                                                      |
| .mode    | \T                | Change the table format used to output results.            |
| .once    | \o [-o] filename  | Append next result to an output file (overwrite using -o). |
| .schemas | \ds               | List schemas.                                              |
| .tables  | \dt [schema]      | List tables.                                               |
| \e       | \e                | Edit command with editor (uses $EDITOR).                   |
| help     | \?                | Show this help.                                            |
| nopager  | \n                | Disable pager, print to stdout.                            |
| notee    | notee             | Stop writing results to an output file.                    |
| pager    | \P [command]      | Set PAGER. Print the query results via PAGER.              |
| prompt   | \R                | Change prompt format.                                      |
| quit     | \q                | Quit.                                                      |
| tee      | tee [-o] filename | Append all results to an output file (overwrite using -o). |
Time: 0.012s

10 20
3 586

I am getting the date 20201121090000 in the HL7 message, How do I convert it to 2020-11-21 09:00:00 in a easy way?

I am currently doing it by extracting the first 7 values and splitting as date and time and then adding a hyphen using substring.

Is there an easier way by using $ZDATE? or something like that?

0 20
0 1.5K
· Aug 16, 2018

I need to start doing unit testing for some of my code.

Why does it delete the unit testing class from Cache when I run the test?

Is there a way to turn this off?

0 20
0 572
· Nov 10, 2021
SQL Search index on JSON objects.

Hello there!
I am hoping to get some help with "SQL Search index" and JSON objects.
I am storing a JSON object in a column of type %Stream.GlobalCharacter
Property JSON As %Stream.GlobalCharacter;
I also have a index that looks like below.
Index AnalyticIdx On (JSON) As %iFind.Index.Analytic(INDEXOPTION = 0, LANGUAGE = "en", LOWER = 1);

1 20
0 403

So, the next year will bring us a new way of installing IRIS. Always keep in mind that you have to bring your own web server. No matter how many instances of IRIS you have on your local machine. Or if you work in Docker, always keep in mind a bit more complicated configuration.

And I now want to understand the costs of this decision for end-developers like most of here.

7 20
2 498

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 481

I'm trying to set up VS Code for ObjectScript using the instructions found here. I've got both Cache 2018.1.2.309.0 and IRIS 2020. When I try to connect to either one of them the connection fails, and I get a notification in the bottom right corner that says "Unexpected token < in JSON at position 0". I've checked the JSON settings file that VS Code uses, and they're fine and formatted properly. All of the settings I've entered are correct.

0 20
0 4.3K

Hi all,

I am trying to create a method to count the number of entries in a global, including all subscripts. I am having a bit of trouble getting the code to make it to the second subscript. When I get to the position where my key is "Canada" and I add a comma and empty quotes to it, it returns USA as the new key when I do the order function. Is the $Order or the global not able to use a single string to represent multiple subscripts?

Here is my global structure:

2 20
0 571

Ran into an issue with our upgrade from HealthShare Health Connect 2018.1.3 to IRIS HealthShare Health Connect 2022.1, that I thought I would reach out about, I already have a ticket open with WRC and started a chat on Discord. We have a couple of MS SQL tables that I have setup as Linked Tables within Cache to query NPI, Patient Account Information, Visit information, etc... When we upgraded last week we found that within a day or even a half a day that we were having problems with our JDBC connections.

0 19
0 228

Cache 2016.2.1.603 for windows)

I created a few classes and one class called jitPod.Api.toServer.additionalConsignments and realised even before I did any work,, that the word "Api" (note capital A) needed to be "api" (all lowercase)

it would not allow copying the class to the lowercase name because the directory already exists (i understand that)

so I exported the class to an XML, edited the xml to become lowercase "api" , deleted all the classes (and directory name) and re-imported the class.

0 19
0 701

Hi Developers!

Often when we develop some library, tool, package, whatever on InterSystems ObjectScript we have a question, how we deploy this package on the target machine?

Also, we often expect that some other libraries already installed, so our package depends on them, and often on some particular version of it.

When you code on javascript, python, etc the role of packages deployment with dependency management takes package manager.

So, I'm pleased to announce that InterSystems ObjectScript Package Manager available!

13 19
4 2.7K
· Sep 29, 2021
Locking / unlocking


What is the best/right way to unlock the object in ObjectScript after the lock was acquired by %OpenId class method? Setting the opened object to null (Set object="") doesn't release the lock.



0 19
0 543


I'm using CircleCI to spin up the image `store/intersystems/irishealth-community:2021.2.0.649.0`.

When building the application we are getting messages that say:

ERROR #5373: Class 'EnsLib.HL7.Message', used by 'Package.Class', does not exist
Skip class Package.Class

Other missing classes seem to include, but not limited to:


0 19
0 302

Good morning
Thank you for taking the time to read this issue.

In interoperability environments, in what way is it recommended to monitor and detect changes in Web Production components between environments, for example between Pre-Production and Production, or even between alternate Nodes of Production Mirrors?

We ask this question in order to find out what are the best practices, and what is the most methodical, systematic, simple, robust and secure way to perform this monitoring.

1 19
0 369

I'm currently working on a custom version control implementation.
I'd like to show differences between a copy of a previously saved routine as a merge of the ^ROUTINE Global and the current version of that same routine.

I've found legacy Documentation for %RCMP which does the trick in the terminal but I'd like a similar result stored inside a variable.
I also want to show differences, not only see if they are the same or not.

The management portal has that exact feature, so maybe someone can direct me to the function that is being used there.

0 19
0 592
· Jan 10, 2021
Code Golf: Diamonds
To start the year let's have a round of CodeGolf!

You know the drill. Shortest solution wins.

Print a size ascending range of Diamonds using the numbers 1 to 9, ranging from size 1 to size N, each diamond separated by a blank line.

A size 1 diamond should look like this, a single centered 1:


With the size N=9 diamond looking like this:

2 19
0 439

Hi Devs!

A few months ago I raised a discussion on the naming convention for ZPM modules.

And you free to put your name or your organization name for the packages you want to have your personal or company's brand.

But if you contribute to community, we suggested to have "community." package for all such libraries.

But the name is too long.

2 19
1 420
· Sep 28, 2020
%Status usage in ObjectScript

Hi developers!

Want to discuss with you the case of %Status.

If you familiar with ObjectScript you know what is it. I'd love to hear the history of the case why it had appeared in ObjectScript but it turned out that almost every system/library classmethods return %Status and there is a whole set of tools to deal with it.

What is does it gives you the responsibility to check the value or %Status of every system method you call.

E.g. if you save the data of the persistent class, you should never call like this:

do obj.%Save()

you need to call:

set sc=obj.%Save()

if $$$ISERR(sc) do // something or quit.

1 19
0 869


We have a global with 65 million entries. All we are doing is just iterating through each entry to find out the total no of entries. It is currently taking 110 minutes. Is this something normal? What can we do to speed up this process? Below is the program for just iterating each entry in the global.

s sub=" ,count=0
s sub=$o(^YYY(sub)) q:sub=""
s count= count +1
w!, "Total Count:"_ count

3 19
1 394

Hi folks!

How can I change the production setting programmatically?

I have a production that is a solution that uses some api-keys, which are the parameters of Business Operations but of course cannot be hard-coded into the source code.

E.g. here is the example of such a production that runs a connection of Telegram and ChatGPT.

And it can be installed as:

zpm "install telegram-gpt"

But now one needs to setup the key manually before using the production, having the following setting:

I'd like to set up it programmatically so one could install it as:

zpm "install telegram-gpt -D Token=sometoken"

How can I make it work?

0 18
0 356