Hey Community,
We're excited to invite you to the next InterSystems UKI Tech Talk webinar:
⏱ Date & Time: Thursday, April 24, 2025 14.30-15.30 UK
👨🏫 Speaker: @Kinshuk Rakshith, Sales Engineer, InterSystems

SQL is a standard language for storing, manipulating and retrieving data in relational databases.
Hey Community,
We're excited to invite you to the next InterSystems UKI Tech Talk webinar:
⏱ Date & Time: Thursday, April 24, 2025 14.30-15.30 UK
👨🏫 Speaker: @Kinshuk Rakshith, Sales Engineer, InterSystems

An experiment on how to use the LangChain framework, IRIS Vector Search, and LLMs to generate IRIS-compatible SQL from user prompts.
This article was based in this notebook. You can run it with a ready to use environment with this application in OpenExchange.
First, we need to install the necessary libraries:
!pip install --upgrade --quiet langchain langchain-openai langchain-iris pandas
Next, we import the required modules and set up the environment:
import os
import datetime
import hashlib
from copy import deepcopy
from sqlalchemy import create_engine
import getpass
import pandas as pdHello,
Our software commonly returns a full result set to the client and we use the DataTables plugin to display table data. This has worked well, but at datasets grow larger, we are trying to move some of these requests server-side so the server handles the bulk of the work rather than the client. This has had me scratching my head in so many ways.
I'm hoping I can get a mix of general best practice advice but also maybe some IRIS specific ideas.
Some background
- I would admit our tables aren't best optimized for SQL in the sense that we don't utilize parent-child relationship in tables
What I find really useful about IRIS when teaching my subject of Postrelational databases is the fact that it is a multi model database. Which means that I can actually go into architecture and structure and all that only once but then show the usage of different models (like object, document, hierarchy) using the same language and approach. And it is not a huge leap to go from an object oriented programming language (like C#, Java etc) to an object oriented database.
However, along with advantages (which are many) come some drawbacks when we switch from object oriented model to relational. When I say that you can get access to the same data using different models I need to also explain how it is possible to work with lists and arrays from object model in relational table. With arrays it is very simple - by default they are represented as separate tables and that's the end of it. With lists - it's harder because by default it's a string. But one still wants to do something about it without damaging the structure and making this list unreadable in the object model.
So in this article I will showcase a couple of predicates and a function that are useful when working with lists, and not just as fields.
Firstly, we need to understand what prompt words are and what their functions are.
Hint word engineering is a method specifically designed for optimizing language models.
Its goal is to guide these models to generate more accurate and targeted output text by designing and adjusting the input prompt words.
I need to generate a DDL file from a .cls class that already exists, the idea is to create a mirror table in SQL. Is it possible to do this export or do I need to do the CREATE TABLE manually?
I have a business service which is responsible for some batch operations with an SQL table. The process is generally slow but it is possible to scale the performance using multithreading and/or parallel processing and logical partitioning (postgres):
select id, col1, col2, mod(row_number() over (), 4) as partition from some_table;
Thus, a partition index will be assigned to each table row. The idea is to create several instances of my business service using pooling (e.g. Pool Size = 4) so each business service instance will be responsible to hande rows belonging to a certain partition, e.g.:
#Here is my code:
Method getStocks(pRequest As Stock.Message.Req, Output pResponse As Ens.StreamContainer) As %Status
{
s tSC = pRequest.NewResponse(.pResponse)
q:$$$ISERR(tSC) tSC
#dim pRS As EnsLib.SQL.GatewayResultSet
s tSC = ..Adapter.ExecuteQuery(.pRS, "select jsonb_agg(s) #>> '{}' FROM prod.stocks s where s.""Warehouse"" = ?", pRequest.Warehouse)
q:$$$ISERR(tSC) tSC
s pResponse = ##class(Ens.StreamContainer).%New()
s pResponse.Stream = ##class(%GlobalCharacterStream).%New()
i pRS.Next() {
d pResponse.Stream.CopyFrom(pRS.GetDataStream(1))
} else
InterSystems Announces General Availability of InterSystems IRIS, InterSystems IRIS for Health, and HealthShare Health Connect 2025.1
The 2025.1 release of InterSystems IRIS® data platform, InterSystems IRIS® for HealthTM, and HealthShare® Health Connect is now Generally Available (GA). This is an Extended Maintenance (EM) release.
Release Highlights
In this exciting release, users can expect several new features and enhancements, including:
The FHIR standard establishes a powerful but flexible data model that can smoothly adapt to the complexities of operational healthcare data management.This flexibility comes at the cost of a data model with many tables and relationships, even for simple data such as the patient's record of telephone numbers, addresses, and emails.It would easily require querying 4 different tables.However, FHIR SQL Builder eliminates this problem, allowing you to create visual projections (mappings) in web wizards.
I have the need to query an external database and write the result set/snapshot to an internal %Persistent [ DdlAllowed ] table that I built. I have built inbound SQL Services before and write them externally to replace SSIS jobs, but how would querying a database via a Service and writing the data to an internal table work?
Can I just take the inbound query structure and write it to the class file of the internal table in a DTL? If so, what would be the Target? Or does this need to be done within a BPL as a Code block?
After so many years of waiting, we finally got an official driver available on Pypi
.png)
Additionally, found JDBC driver finally available on Maven already for 3 months, and .Net driver on Nuget more than a month.
As an author of so many implementations of IRIS support for various Python libraries, I wanted to check it. Implementation of DB-API means that it should be replaceable and at least functions defined in the standard. The only difference should be in SQL.
And the beauty of using already existing libraries, that they already implemented other databases by using DB-API standard, and these libraries already expect how driver should work.
I decided to test InterSystems official driver by implementing its support in SQLAlchemy-iris library.
My query that I am running on my Custom SQL Inbound Service has columns that are larger than the typical string length. How do I enlarge the SQL Snapshot Column limitations
Class osuwmc.Epic.Clarity.DepartmentMaster Extends%Persistent [ DdlAllowed ]
{
Parameter USEEXTENTSET = 1;Property CostCenter As%String(MAXLEN = 15) [ SqlColumnNumber = 2 ];Property ID As%String [ Required, SqlColumnNumber = 3 ];
Index IDIndex On ID;Property Abbr As%String(MAXLEN = 20) [ SqlColumnNumber = 4 ];Property Name As%String(MAXLEN = 254) [ SqlColumnNumber = 5 ];Property ExternalName As%String(MAXWe recently changed the 'UserID" property in a "User" class from type of %String to be %Library.Username. This is for better consistency across our codebase regarding MAXLEN limit.
%Library.Username is a system wrapper datatype which extends %String and has a MAXLEN of 160. This change should have minimal/no impact on code behavior. However, we found that some SQL query cannot return expected rows after the change. Query will return empty values even if the entry is in the table.
After investigation, we found that re-building index could solve the issue, which means the data type change caused
Using IRIS 2024.1.2 when I mount the routine database as read-only I get an error when executing dynamic SQL queries.
What globals need to be mapped in a read-write database in order to allow execution plans to be written?
If your need is interactions between the client and the application (and consequently the database), Dynamic SQL may be more appropriate, as it "adapts" very easily to these query changes.However, this dynamism has a cost: with each new query, it is remodeled, which can have a higher cost to execute.Below is a simple example of a Python code snippet.
Using SQL Gateway with Python, Vector Search, and Interoperability in InterSystems Iris
Part 3 – REST and Interoperability
Now that we have finished the configuration of the SQL Gateway and we have been able to access the data from the external database via python, and we have set up our vectorized base, we can perform some queries. For this in this part of the article we will use an application developed with CSP, HTML and Javascript that will access an integration in Iris, which then performs the search for data similarity, sends it to LLM and finally returns the generated SQL. The CSP page calls an API in Iris that receives the data to be used in the query, calling the integration. For more information about REST in the Iris see the documentation available at https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…
Introduction
To achieve optimized AI performance, robust explainability, adaptability, and efficiency in healthcare solutions, InterSystems IRIS serves as the core foundation for a project within the x-rAI multi-agentic framework. This article provides an in-depth look at how InterSystems IRIS empowers the development of a real-time health data analytics platform, enabling advanced analytics and actionable insights. The solution leverages the strengths of InterSystems IRIS, including dynamic SQL, native vector search capabilities, distributed caching (ECP), and FHIR interoperability. This innovative approach directly aligns with the contest themes of "Using Dynamic SQL & Embedded SQL," "GenAI, Vector Search," and "FHIR, EHR," showcasing a practical application of InterSystems IRIS in a critical healthcare context.
In the world of APIs, REST is very extended. But what happens when you need more flexibility in your data-fetching strategies? For instance letting the client to choose what fields is going to receive. Enter GraphQL, a query language for your APIs that provides a flexible alternative to REST.
In this post, we will:
Hi Everyone!
The Certification Team of InterSystems Learning Services is currently developing an InterSystems ObjectScript Specialist certification exam. Earlier this month we reached out to our community for feedback that will help us evaluate and establish the contents of this exam. We are still currently accepting responses and would love to hear your feedback!
Please note that this is one of two exams being developed to replace our InterSystems IRIS Core Solutions Developer exam. You can find more details about the other exam, InterSystems IRIS Developer Professional exam, here.
How do I
Hi Community,
I've created a method in my File Service to do a cleanup for every file load. Currently, I've set it to delete data when LastUpdated date is greater than maxdate. However, I want to do a cleanup for every new file load. Any suggestions or advice on how to do this? Thanks!
Method Cleanup()
{
Set tMaxDate = ""
&SQL(SELECT Max(LastUpdated) into :tMaxDate
FROM MC_Table_Data.Patient)
&SQL(DELETE MC_Table_Data.Patient WHERE LastUpdated<:tMaxDate)
}
Hello,
So i want to use the INSERT OR UPDATE command so i can update a COUNTER for a given name:
INSERT OR UPDATE myTable
SET name='Omer', counter = counter + 1;
as you can see with the above code - if the row is non-existent then we get an error because COUNTER is NULL!
I tried the following to fix this but all have failed:
INSERT OR UPDATE myTable
SET name = 'Omer',
counter = CASE
WHEN counter IS NULL THEN 1
ELSE counter + 1
END
INSERT OR UPDATE myTable SET name='Omer',counter = COALESCE(counter + 1, 1)
INSERT OR UPDATE myTable SET name='Omer',counter =
Hi Community,
This is a detailed, candid walkthrough of the IRIS AI Studio platform. I speak out loud on my thoughts while trying different examples, some of which fail to deliver expected results - which I believe is a need for such a platform to explore different models, configurations and limitations. This will be helpful if you're interested in how to build 'Chat with PDF' or data recommendation systems using IRIS DB and LLM models.
February 19, 2025 – Alert: SQL Queries Returning Wrong Results
InterSystems has corrected two issues that can cause a small number of SQL queries to return incorrect results. In addition, InterSystems has corrected an inconsistency in date/time datatype handling that may lead to different, unexpected – yet correct – results for existing applications that rely on the earlier, inconsistent behavior.
DP-436825: SQL Queries with Lateral Join May Return Wrong Results
The first issue (DP-436825) only affects SQL queries that use a lateral join, either implicitly or explicitly, on an instance
Hello!
So my question is quite simple, Do the different data models of Intersystems all support the ACID properties?
I assume that for the SQL data model implementation it does, But does it also work for global (i.e the hierarchical data model)?
I searched the docs and the different articles, It seems for example that here its implied that the different data models of Intersystems DO indeed support the ACID properties and allow for safe insertion, deletion etc... in concurrent operations to the server that is.
Would love to get a clarification, Thx!
Hi Folks!
Have a very simple question, I hope :)
How can I make sure that user 'John' is already created in the IRIS system?
Preferabbly via SQL?
thanks a lot!
Using SQL Gateway with Python, Vector Search, and Interoperability in InterSystems Iris
Part 2 – Python and Vector Search
Since we have access to the data from our external table, we can use everything that Iris has to offer with this data. Let's, for example, read the data from our external table and generate a polynomial regression with it.
For more information on using python with Iris, see the documentation available at https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=AFL_epython
Let's now consume the data from the external database to calculate a polynomial regression. To do this, we will use a python code to run a SQL that will read our MySQL table and turn it into a pandas dataframe:
Using SQL Gateway with Python, Vector Search, and Interoperability in InterSystems Iris
Part 1 - SQL Gateway
Hello
In this article we will look at the use of SQL Gateway in Iris. SQL Gateway allows Iris to have access to tables from other (external) database via ODBC or JDBC. We can access Tables or Views from various databases, such as Oracle, PostgreSQL, SQL Server, MySQL and others.
Hello,
It's possible to set a value to a "variable" in SQL Cache?
Like in SQl Server or Oracle?
Thanks
In MySQL I have the following table:
CREATE TABLE `info` ( `created` int(11) );
And it is linked (via JDBC SQL Gateway) to Cache table mysql.info. `created` field stores unix timestamp. So when I execute this SQL in SMP:
SELECT created FROM mysql.info
I receive the following output (which is expected):
| created |
| 1435863691 |
| 1436300964 |
But I want to to display `created` field converted to ODBC timestamp format. To do that I call this SQL procedure
Class mysql.utils [ Abstract ]
{
/// Unix timestamp to ODBC
ClassMethod uto(unixstamp As %Integer) As %TimeStamp [ SqlName =