Robert Cemper · Apr 26, 2020 5m read
Materialized Views

A VIEW in SQL is basically a prepared SQL statement.
It has to be executed and assembled like any other SQL query.
MATERIALIZED VIEW means that the content is collected before hands and can be retrieved rather fast.
I saw the concept first with my favorite competitor named O* and they made a lot of noise about it.

  { favorite: because I could win every benchmark against them devil }

1 3 380

I have created a custom role in IRIS for users to provide limited view-only access for querying tables in the HSANALYTICS namespace. WinSQL has been installed on a Windows server (WinSQL Lite version and an ODBC connection entry has been created in WinSQL for the users to log in and run SQL queries. The custom role provides the roles/resources included in the attached file. The WinSQL System DSN entry defined is:

Health Insight UAT HSANALYTICS    64-bit    InterSystems ODBC35

The ODBC35 driver is defined as:

0 7 126


We have a need to track Database changes over time - down to the SQL level of granularity if possible. Such as: User xyz runs routine ^abc and we get something similar to a changelog that tells us: table A had this value updated, insert, update etc....

Is that possible using IRIS level tools (Audit Log, Journal File, etc...) , is there a way to convert the global sets and kills from the journals into SQL level changes?


1 3 166

I am trying to populate a table using the sql Data Import Wizard. The input file is a tab delimited text file. But the import keeps failing with a 104 error showing validation for the columns which use %Library.TimeStamp and %Boolean datatypes is failing. Yet when I insert values into the table through a SQL insert command, the values get saved correctly in the table.

For the TimeStamp format in the wizard form, I am choosing YYYY-MM-DD-HH:MI:SS because  there was no option for this format: YYYY-MM-DD HH:MM:SS. 

0 4 93

I'm using a JDBC driver to connect PGSQL -> Cache.  I'm noticing when I run SELECT queries and COUNT(*) command against the same table, I get different result sets.  I'm pretty new to Cache in general - so I'm trying to understand why these would be different. 

Examples (TransID and InvNum should occur in every "row"):

SELECT COUNT(*) FROM ACCT.Services = 1,090,324 WHERE ACCT.Dept = 483

SELECT TransID FROM ACCT.Services = 1,085,776 WHERE ACCT.Dept = 483

SELECT InvNum FROM ACCT.Services = 586,023 WHERE ACCT.Dept = 483

0 8 86
Eduardo Anglada · May 11 8m read
IRIS in Astronomy

In this article we are going to show the results of the comparision between IRIS and Postgress when handling Astronomy data.


Since the earliest days of human civilization we have been fascinated by the sky at night. There are so many stars! Everybody has dreamed about them and fantasized about life in other planets.

0 7 318
Jude Mukkadayil · May 12
Cache sql query

Hi ,

     I am trying to retrieve the contact type column data of a patient based on the recent date as shown below.

for instance

 contacttype      Datefrom

contact 1.       24/03/2020

contact 2.        20/05/2021

i need to retrieve the second contact2 based on the recent date.

i tried  like below but not working .

Case max(datefrom) >0 then contacttype

End as contacttype


Can anyone please tell me why this is not working.Any other options?




0 3 126

I need to show the absence of data, so I have to join the list of predefined values with a result of a select statement.
However, it seems like Table Value Constructors in JOIN are either not supported, or I do not understand the syntax.
Basically, I am going for something like this:

Select v.valueId, 
 From (values (1), (2), (3), (4), (5)) v(valueId)
     left Join otherTable m
        on = v.valueId

Is it supported in Cache SQL or not?

0 6 108


I'm getting thousands of errors like the ones below:


2021-05-03 14:11:44 [SQLCODE: <-400>:<Ocorreu um erro fatal>] [Cache Error: <<READ>Dispatch+14^%SYS.BINDSRV>] [Location: <ServerLoop>] [Client info: <Username: KIORAS, Node Name: 3IK0VLS5UU, IP Address:, Executable Name: EXTRService.exe, Internal Function: B0>] [%protocol: <52>] $Id: //ce/2018.1.2/kernel/common/src/aclass.c#1 $ 23468 104


0 1 93

The boss (reasonable intelligent ;-) wants to connect to the cache database through Excel, but unless I explain what he's looking for (field names DB names etc) then I can see him continually coming back for "what's the link here and how do I get the delivery company name etc etc"


is there a SAFE way I can give him access to our database using an intelligent visual user interface.

I had thought about the SQL Query Builder within the management portal, but the thought of giving him access to all of the other functionality of the management portal.

0 3 139

Hello everyone!

Some time ago, I changed the configuration in SQL Runtime Statistic to "Turn on Stats code generation to gather stats at the Open and Close of a query". With this change, the CACHE base (cache/mgr/cache/) has grown a lot to reach 198GB.

Yesterday, I returned the configuration of SQL Runtime Statistic to the default which is "Turn off Stats code generation" and the cache base is no longer growing.

My question is?

0 3 91

In the good old days (tm) determining the size of the data, streams, and indices for a class/table was easy - you just ran %GSIZE and check D, S, and I globals respectively.

However, nowadays sharding, optimized global names, and indices in separate globals produce %GSIZE output looking like this:

2 2 307

Following instructions on this page I am trying to create a Data Connector to be used as a base class for a cube with update support.
That page suggests that putting an SQL query inside XData block is not suitable for a Data Connector that supports updates.
Later it also suggests that to enable updates your SQL query must include 

0 2 114

Hello everyone,

First, thanks in advance for your help :-)

I noticed that a query called directly in a method of a class of a business operation does not return the same result as if I apply the same query in the same Caché database from Squirrel !!! 

I don't understand why ??? 

Here is the query : 

0 4 107

Background: We have our own SQL map that predates InterSystems'. A program writes an XML file for each table map class as $system.OBJ.Export would. $system.OBJ.LoadDir loads the XML files into .cls files.

The reason is a long story, but we need to update parameter EXTENTSIZE (only) in existing classes. This does not seem to happen. As a test I used $system.OBJ.Export to make an XML file and edited EXTENTSIZE in the two places it appears in the XML:

0 4 134



I'm doing a query in SQL and I need to sort my data by some non-repeated field.


Unfortunately, my data is grouped in a way that I cannot guarantee that any column will not have repeated data, so one solution would be to take the row number.


Also, the Cache is not accepting Row_Number () in my querry and I would like to know if there is another solution to return line numbers or some way to add this function to the Cache.


Best regards.

0 7 396