#SQL

9 Followers · 1.2K Posts

SQL is a standard language for storing, manipulating and retrieving data in relational databases.

Article Alberto Fuentes · Feb 13 10m read

10:47 AM — Jose Garcia's creatinine test results arrive at the hospital FHIR server. 2.1 mg/dL — a 35% increase from last month.

What happens next?

  • Most systems: ❌ The result sits in a queue until a clinician reviews it manually — hours or days later.
  • This system: 👍 An AI agent evaluates the trend, consults clinical guidelines, and generates evidence-based recommendations — in seconds, automatically.

No chatbot. No manual prompts. No black-box reasoning.

3
4 590
Article Nicky Zhu · Oct 16 10m read

A connection test can tell you that a server responded. A schema can tell you that a column is named Code. Neither tells you, by itself, what that code represents or whether it belongs in a particular target field.

That distinction is where reliable integration design begins. Before deciding which source asset maps to which target, or which components should form a pipeline, we need to understand the interfaces—not just their shapes, but what those shapes mean in context.

This article explains how DataPipelineDemo approaches that problem on InterSystems IRIS for Health.

0
0 37
Question Thembelani Mlalazi · Mar 27, 2018

Morning guys  I have a SQL operation that I use to read data and results to a record map. But seems to have trouble saving the objects to a record map as I get this message

ERROR ErrException:
zInsertObject+2^%Library.RelationshipObject.1 -- logged as '-' number - @''

please help  here is my code let me know if I missing anything thank you in advance

Method OnRequest(pRequest As DQToolsSet.PrimaryMessageREQ, Output pResponse As HSCIC.DBS.RequestRBAT) As %Status
{
 #dim status as %Status=$$$OK
    #dim resultSet as %SQL.StatementResult
   
    set pobject=##class(%FileCharacterStream).%New()
   
    set preq=##class(HSCIC.DBS.RequestRBAT).%New()
   
   
 
 set status=..Adapter.ExecuteQuery(.resultSet,..GetTheSubmissionData(pRequest.pMonth, pRequest.pApp, pRequest.pRef, pRequest.pInPat))

nbsp;if ($$$ISOK(status))
 {
  While (resultSet.%Next(.status) && $$$ISOK(status))
  {
  set ppResponse=##class(HSCIC.DBS.RequestRMAP.Record).%New()
     set ppResponse.RequestCode=resultSet.Get("recType")
        set ppResponse.PatientID=resultSet.Get("ClientID")
        set ppResponse.DOB=resultSet.Get("DOB")
        set ppResponse.Property4=resultSet.Get("u1")
        set ppResponse.Property5=resultSet.Get("u2")
        set ppResponse.NHSNumber=resultSet.Get("NNN")
        set ppResponse.Surname=resultSet.Get("Surname")
        set ppResponse.AltSurname=resultSet.Get("u3")
        set ppResponse.GivenName=resultSet.Get("GivenName1")
        set ppResponse.AltGivenName=resultSet.Get("u4")
        set ppResponse.SpineGender=resultSet.Get("Gender")
        set ppResponse.Address1=resultSet.Get("a1")
        set ppResponse.Address2=resultSet.Get("a2")
        set ppResponse.Address3=resultSet.Get("a3")
        set ppResponse.Address4=resultSet.Get("a4")
        set ppResponse.Address5=resultSet.Get("a5")
        set ppResponse.PostCode=resultSet.Get("Postcode")
        set ppResponse.AltAddress1=resultSet.Get("p1")
        set ppResponse.AltAddress2=resultSet.Get("p2")
        set ppResponse.AltAddress3=resultSet.Get("p3")
        set ppResponse.AltAddress4=resultSet.Get("p4")
        set ppResponse.AltAddress5=resultSet.Get("p5")
        set ppResponse.AltPostCode=resultSet.Get("p6")
        set ppResponse.GPCode=resultSet.Get("GPCode")
        set ppResponse.GPPracticeCode=resultSet.Get("PracticeCode")
        set ppResponse.NewField3=resultSet.Get("u5")
        set ppResponse.NewFiel23=resultSet.Get("u6")
  
   set status=ppResponse.%Save()
   set pobject=ppResponse
  
  set pResponse=##class(HSCIC.DBS.RequestRBAT).%New()
  
   if ($$$ISOK(status))
   {
    set status=pResponse.Records.InsertObject(pobject)
    set status=pResponse.Records.%Save()
   
      }
  
  
  }
  }
  }
6
0 855
Article Anton Yartsev · Oct 13 6m read

Hi, community!

There's a Russian proverb: "to kill two rabbits with one shot". In English, if I'm not mistaken, it's "to kill two birds with one stone". We won't kill anyone, but we'll try to implement two ideas at once: DPI-I-543 about Hugging Face and DPI-I-1012 about Kaggle. Both ask for a way to get a public dataset into IRIS without manual work. And test them on a real project rather than a toy example. Well then.

Image

2
0 55
Article David Hockenbroch · Feb 25 2m read

Inspired by @Ashok Kumar Thangavel's post on the ideas portal here as well as my own wishes for a solution to this problem, I have come up with a simple way to allow more complete and consistent JSON queries without having to specify every desired field. I have created a class that extends the built-in %JSON.Adaptor class and makes its %JSONExportToString and %JSONExportToStream methods accessible through SQL with just a couple of simple SqlProc Methods.

Class DH.JSONAdaptor Extends %JSON.Adaptor [ Abstract ]
{
ClassMethod jsonstring(id, map = "") [ SqlProc ]
{
	try{
		set myobj = ..%OpenId(id)
		set sc = myobj.%JSONExportToString(.json,map)
		if $$$ISERR(sc) $$$ThrowStatus(sc)
		return json
	}
		catch ex{
		throw ex
	}
}

ClassMethod jsonstream(id, map = "") [ SqlProc ]
{
	try{
		set myobj = ..%OpenId(id)
		set sc = myobj.%JSONExportToStream(.json,map)
		if $$$ISERR(sc) $$$ThrowStatus(sc)
		return json
	}
	catch ex{
		throw ex
	}
}
}
4
1 455
Article Muhammad Waseem · Oct 13 7m read

Hugging Face has made thousands of datasets accessible to developers working in machine learning, natural language processing, analytics, and artificial intelligence. InterSystems IRIS provides a powerful platform for storing, querying, and processing data. Bringing these two ecosystems together creates interesting possibilities for developers who want to experiment with real-world datasets directly inside IRIS.

However, importing a dataset is more than downloading a file and inserting rows into a table.

1
0 53
Job Scott Weithman · Oct 12

About Us

Founded in 2021 by Heather Capel, a veteran of the HIE and HIT professional services industries, LEAD North seeks to innovate on how professional services are offered, retained, and fulfilled. By combining a 100% remote workplace with a mindset focused around evolving the industry, LEAD North looks to provide better services at more competitive rates for the clients we serve. Our firm brings decades of combined experience operating in the HIE space, working with all forms of Health Data from clinical to payer sources.
0
1 76
Article Nicky Zhu · Oct 12 13m read

An LLM can suggest that a source column belongs in a particular target field. That is useful—but it is not yet an integration.

Someone still has to establish the connection, understand the target's constraints, choose the right components, connect them, start the pipeline, and check what actually arrived.

The Quickstart introduced DataPipelineDemo, a working demo on InterSystems IRIS for Health. This article explains the design behind it: how integration requirements and available platform capabilities become a running, verifiable pipeline.

The central idea is not “ask AI to write everything.” It is:

Let AI make integration decisions within explicit boundaries, then make those decisions executable, observable, and testable.

0
0 44
Article Emil Polakiewicz · Mar 10 19m read

How to set up RAG for OpenAI agents using IRIS Vector DB in Python

In this article, I’ll walk you through an example of using InterSystems IRIS Vector DB to store embeddings and integrate them with an OpenAI agent.

To demonstrate this, we’ll create an OpenAI agent with knowledge of InterSystems technology. We’ll achieve this by storing embeddings of some InterSystems documentation in IRIS and then using IRIS vector search to retrieve relevant content—enabling a Retrieval-Augmented Generation (RAG) workflow.

Note: Section 1 details how process text into embeddings.

2
1 536
Article Henrique Dias · Oct 9 5m read

In 2020 I wrote iris-fhir-portal for the FHIR contest, and explained it in four articles:

  1. My experience working with FHIR
  2. Overview of iris-fhir-portal
  3. Updating Patient resource using fhir.js
  4. Getting FHIR information using SQL

The portal is still installed by the iris-fhir-template (zpm "install fhir-portal"), but on a current IRIS it no longer worked: the lab results page came up empty, the SQL schemas of the articles were gone, and the pages had no login. This post is about bringing it to IRIS for Health 2026.2, and about what changed in each article.

The patient chart

2
0 98
Article Harshitha · Oct 4 3m read

Hey besties, Harshi (🌊 👋) here.

I hope all are having a nice weekend evening while Monday crawls up the neck. 👺

Yeah, so, last week I was working on a list of datasets involving a list of drugs, where every generic-brand-dose combination is assigned a unique drug code by the local regulatory authority. The task was to identify items in the table that followed that specific region pattern while filtering out the other codes. Since LIKE was not precise enough, I turned to pattern matching for this task.

So let's see what a %PATTERN is!

1
0 83
Article GUILHERME CRUZ DA CUNHA · Oct 6 4m read

When we talk about application security, authentication and passwords are usually the first things that come to mind. But for systems that store and process critical data, security needs to go much further than that.

One of the aspects I find particularly interesting about InterSystems IRIS is its layered security approach. Instead of relying on a single protection mechanism, IRIS combines authentication, authorization, encryption, secure communications, auditing, and hardening capabilities.

0
0 50
InterSystems Official Daniel Palevski · Sep 30

InterSystems announces its fifth preview as part of the developer preview program for the 2026.3 release. This release includes InterSystems IRIS® data platform, InterSystems IRIS for Health™, and InterSystems Health Connect™. 

Highlights

Many additional updates and enhancements have been added since Preview #4:

  • New SQL performance analysis capabilities with SHOW PLAN ANALYZE and enhanced runtime metrics.
  • Improved developer productivity through Visual Studio Code OAuth2 authentication support and enhanced server file management.
  • Messaging Client 1.7.
0
0 89
Article Dawid Kryński · Sep 27 6m read

Live demo: https://niutics.pl/interSystems (sign in as demo / demo, or operator / for a limited role) · GitHub: https://github.com/DawidKrynski/iris-admin-deck · Open Exchange: https://openexchange.intersystems.com/package/IRIS-Admin-Deck

Video, 3 minutes: https://youtu.be/gUsxZi-uAD4

IRIS 2026.2 added the SysAdmin REST API, . Its OpenAPI file has 190 paths and 273 operations and covers most of what I normally do in the Management Portal. For the

0
0 100
Article Mario Sanchez Macias · Feb 19, 2025 4m read

So, you checked your server and saw that IRISTEMP is growing too much. There's no need to panic. Let’s investigate the issue before your storage runs out.

Step 1: Confirm the IRISTEMP Growth Issue

Before assuming IRISTEMP is the problem, let’s check its actual size.

Check the Free Space

Run the following command in the IRIS terminal:

%SYS>do ^%FREECNT

When prompted, enter:

Database directory to show free space for (*=All)? /<your_iris_directory>/mgr/iristemp/

If the output shows very low free space, IRISTEMP is filling up your storage like an overstuffed closet

5
4 762
Article GUILHERME CRUZ DA CUNHA · Sep 24 8m read

Introduction

When developing applications with InterSystems IRIS, most developers naturally think in terms of SQL tables or persistent classes.

However, underneath the SQL and object models there is another fundamental data structure: globals.

Globals are persistent, multidimensional, sparse arrays. They can contain multiple levels of subscripts, and those subscripts do not need to be contiguous. This makes globals particularly interesting for certain types of data that do not naturally fit into a traditional relational structure.

1
1 114
Article David Hockenbroch · Sep 23 11m read

The persistent class is the foundation of data in InterSystems IRIS. The serial class is its sibling; it can be a great helper, but it is a bit temperamental. It has some extra considerations, especially around triggers and automatically calculated fields. This article will help you understand how these classes work differently. By the end, you will know how to make the serial class behave.


TL;DR

Serial classes are a great tool to save you time on otherwise repetitive work.

2
0 137
Question Christian Asmussen · Sep 17

Environment

  • InterSystems IRIS for Health, Community Edition, image intersystemsdc/irishealth-ml-community:2026.1
  • Platform: Docker, Ubuntu 24.04 LTS host, aarch64 (Apple Silicon / ARM64)
  • Embedded Python: 3.12.3 (confirmed via ##class(%SYS.Python).GetPythonInfo()), CPF_PythonPath correctly set to the packages directory
  • sklearn, , all import cleanly through the embedded Python bridge

Problem

Every TRAIN MODEL ... USING {...} call fails with NoEstimatorChosen, regardless of:

  • (tried , 0.50, and omitted entirely — all fail)
1
1 91
InterSystems Official Daniel Palevski · Sep 16

InterSystems announces its fourth preview, as part of the developer preview program for the 2026.3 release.  This release will include InterSystems IRIS® data platform, InterSystems IRIS® for HealthTM, and InterSystems Health Connect™.

Highlights

Many updates and enhancements have already been added in 2026.3:

  • Broader support for table partitioning across additional SQL table types. 
  • New Config Store capability for managing application configuration and secrets via secure wallet.
  • Improved cloud-native operations, with container-related observability changes.
0
0 159
Article Vachan C Rannore · Dec 28, 2025 1m read

SETassigns value to the variable at RUNTIME.

#DIM declare the variable and it's Data Type at COMPILE TIME.


SET #DIM
Makes the variables Dynamic. Improves Readability.
No Data Type Declaration. Enables IDE auto-completion.
Runtime Useful for Object references.

As%String

or #DIM? Your design, your rules.

23
5 671
Article Guilherme Mendes · Sep 11 3m read

Persistent classes are one of the features that make InterSystems IRIS different from a traditional application database. Instead of designing database tables separately from application objects, developers can define a class and allow IRIS to manage its persistent representation. This creates a close relationship between the application's object model and the underlying data model.

A basic persistent class inherits from %Persistent:

Class MyApp.Product Extends %Persistent
{
    Property Name As %String;
    Property Price As %Numeric;
    Property Stock As %Integer;
}
0
0 142
Question Iain Gorton · Sep 10

Hello world!  I thought EDITED errors were eliminated several versions ago, but a client of ours recently produced a lot of them, and following this they also receive Continuous CRC mismatch errors on a routine that was being compiled when this error was triggered.  I suspect the following commands will resolve the CRC errors:

D $SYSTEM.SQL.Statement.Clean()

D $SYSTEM.SQL.FreezePlans(0,,,.Errors) ZW Errors   ; you want to see Errors=0

D $System.SQL.Purge(0)

But would like to replicate the issue to prove it, and/or make changes to avoid it altogether.

1
0 153
Article Jorge Jaramillo Herrera · Jan 9 9m read

1-command only required for an entire IRIS instance for Data Science projects, and leveraging this to compare query methods' speed (Dynamic SQL, Pandas Query, and Globals).

Image

Before joining InterSystems, I worked in a team of web developers as a data scientist. Most of my day-to-day work involved training and embedding ML models in Python-based backend applications through microservices, mainly built with the Django framework and using Postgres SQL for sourcing the data.

5
2 306
Article Heloisa Paiva · Aug 31 14m read

TL;DR

We connected InterSystems Reports, powered by Logi Report from insightsoftware (Designer + Server), to a production InterSystems IRIS instance to deliver branded, scheduled PDF and Excel reports built on IRIS SQL views. This article is the walkthrough we would have liked to have on day one: least-privilege IRIS setup, a reliable JDBC configuration, SQL views as the contract between IRIS and the reporting layer, and branding centralized in CSS plus a template report.

0
2 235
Article Murray Oldfield · Sep 24, 2024 7m read

Problems with Strings

I am accessing IRIS databases with JDBC (or ODBC) using Python. I want to fetch the data into a pandas dataframe to manipulate the data and create charts from it. I ran into a problem with string handling while using JDBC. This post is to help if anyone else has the same issues. Or, if there is an easier way to solve this, let me know in the comments!

I am using OSX, so I am unsure how unique my problem is. I am using Jupyter Notebooks, although the code would generally be the same if you used any other Python program or framework.

1
0 875
Article José Pereira · Nov 26, 2025 10m read

In Part 1, we explored how window functions operate. We learned the logic behind PARTITION BY, ORDER BY, and such functions as ROW_NUMBER() and RANK(). Now, in Part 2, let's delve into more window functions with practical examples.


1. Aggregate-over-Window Functions

Overview

These functions compute an aggregate (e.g., sum, average, min, max, count, etc.) over the defined window frame but don’t collapse rows. Each row remains visible, augmented with aggregated values for its partition.

Supported functions include the following:

  • AVG() — average of values in the window frame.
1
1 511
Article Tani Frankel · Dec 22, 2025 1m read

Looking at my database I see I have a very big ^rINDEXSQL global? Why is that? 😬

In the Management Portal SQL page, under "SQL Statements" I see a 'Clean stale' button - what does this do? 🤔

In the list of Statements some have a 'Location' value and some don't? How is that? 🤨

2
2 319
Article Thomas Dyar · Jul 29 10m read

Part 1 of a series. Part 2 covers the full tool catalog. Part 3 covers ObjectScript skills. Part 4 covers benchmarking and measuring what actually improves.


The Problem Hiding in the Comments

Thomas Mazur's post "Frogs, Chickens, AI, and VS Code" on VS Code productivity — Peacock, scoped workspace files, Copilot Agent mode — drew a sharper problem in the comments. Pietro Di Leo and Mike.W pointed out that when you work server-side in VS Code, the isfs:// workspace most production IRIS shops use, Copilot can only see the files open in your editor It cannot index the virtual filesystem.

9
10 617
Announcement Andreas Schneider · Aug 24

The goal of this release was straightforward: make day-to-day work with InterSystems IRIS and Caché a little easier.
Here are the five biggest changes.
- Query Cloud can now join multiple databases in a single query
SQL Data Lens uses Apache Calcite to federate queries across different sources while pushing filters, joins and aggregations down to each system whenever possible.
IRIS + PostgreSQL + a folder full of CSV files.
One SQL statement.
- SQL History is now searchable
The old day-by-day tree is gone.
History entries can be sorted, filtered, pinned and exported.

0
0 106