Hey guys,
I need your help.

I am writing a code in Python and I want to create a database and some properties and then to send json files (data) to this database. (I use client-server-model for loading the data into IRIS)

I use curl methods and convert it in Python code with:


My code so far:

0 15
0 325


I am experimenting with Cache-Python binding. In the following piece of Python code

import intersys.pythonbind3

conn = intersys.pythonbind3.connection( )
conn.connect_now('localhost[1972]:SAMPLES', '_SYSTEM', '123', None)
samplesDB = intersys.pythonbind3.database(conn)
p10 = samplesDB.openid("Sample.Person",'10',-1,-1)


0 14
0 698

I have a table, with autoincremented id

    name VARCHAR(30) NOT NULL,
    PRIMARY KEY (id)

I can add a new item there with an explicit id

INSERT INTO users (id, name) VALUES (2, 'fred')

And while my id is autoincremented, I can omit it

INSERT INTO users (name) VALUES ('ed')

So, this time, I don't know the id, and I want to somehow get it.

I could do it with LAST_IDENTITY() function, but it just uses %RowID, and have no relation to the primary id

0 12
0 342

This is not an issue in ObjectScript, due to its typeless nature. But it's essential for external programming languages that care a bit more about types of variables.

And in any case, it's still reproducible in ObjectScript. I have table

CREATE TABLE some_table (
        id INTEGER NOT NULL, 
        x INTEGER, 
        y INTEGER, 
        z VARCHAR(50), 
        PRIMARY KEY (id)

And data

INSERT INTO some_table (id, x, y, z) VALUES (1, 1, 2, 'z1');
INSERT INTO some_table (id, x, y, z) VALUES (2, 2, 3, 'z2');
INSERT INTO some_table (id, x, y, z) VALUES (3, 3, 4, 'z3');
INSERT INTO some_table (id, x, y, z) VALUES (4, 4, 5, 'z4');

1 11
0 257

Hello everyone,

Im just wondering if there is any possibility to "Listen" to a cache DB? We have our cache DB somewhere else provided by a different company, we are provided the interface to connect to that cache DB so we can extract the cache DB every night.

Im just curious if theres a way to "listen" to the cache DB, so if theres any changes on the table in the cache DB, I could make a trigger to extract the table again.

I know i could just set my ETL every hour or so... but that would extract all the tables in cache DB.

0 9
0 660

I have a simple python script to pull table information from cache 2018.1.2 which is on a windows 10 machine. I get no results though the same query in the management portal works correctly:

import os
import sys
import intersys.pythonbind3 as ipyb
import numpy as np

# Connect to the Cache' database
url = "localhost[1972]:%SYS"
user = "xxxx"
password = "zzzzz"

accessKey = (url, user, password)

def main(accessKey):

0 8
0 171

I have done Python - Cache binding setup following the guide from http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=.... I have also run test.py from sample3 folder and it able to run and complete successfully.

However, when I try to run the same test.py code via $zf, it gives error with exit code 1.

I've tried running help("intersys.pythonbind3") via $zf and also running from Cache terminal as follows:

0 6
0 576

I am writing a Python tool to query our cache instances for various information. I have set up the connection without issue:

import intersys.pythonbind3 as pyb

conn = pyb.connection()

db = pyb.database(conn)
qry = pyb.query(db)
obj = pyb.object(db)

I wanted to make the call:

execRes = qry.prepare_class("SYS.Database",'FreeSpace')

But fetching fails because of data mismatches ( as I understand from other posts) and my testing bears out this type of failure.

0 6
0 103


I believe that the Perl and Python bindings that exist on Cache / Ensemble do not exist on IRIS for Health 2020.1 ... is that correct?

Is there any similar documentation and samples (like below) , that show an example of how to run a basic Perl or Python script that connects with ODBC or whatever the recommended way?


0 6
0 115
Marlin Mixon · Nov 4, 2021
IRIS Language Bridge Python

At the recent virtual conference I saw the demonstration on being able to run Python within ObjectScript and run ObjectScript within Python thanks to a feature called Language Bridge. Is this available now? If so, am I able to install it? I am currently running HealthShare 2020.1. I have a little bit of experience using Irisnative with Python but was intrigued with the more seamless-looking features offered by the Language Bridge.

Thanks for any insight.

Marlin Mixon

1 5
0 211


What is the Python syntax I can use from a ClassMethod (developed in an IRIS using embedded Python), in order to invoke another class method,

- in the same class; and

- in another class.

I see 'self' is synonymous to use $this (..) in ObjectScript, but these are ClassMethods I am invoking, and self did not seem to work.

thanks - Steve

1 5
0 212

I am in the process of creating a python report writer that includes the information contained in "License Usage" page of the management portal. I think I have a handle on the local values contained in the report using the %SYSTEM.License class I have those defined using these methods:

Current License Units Used - -> LUConsumed

Maximum License Units Used --> LUMaxConsumed

License Units Enforced --> KeyEnforcedUnits

License Units Authorized --> KeyLicenseUnits

0 5
0 220

Hi folks!

How can I refer to a classmethod of the same class while coding another classmethod with Embedded python?

I know that I can call it with iris.cls(classname).MethodName(), but it's more cumbersome even comparing with ObjectScript, where I can call ..MethodName().

Compare ObjectScript:

do ..SetupGame()

and the same call in EmbeddedPython:



0 5
0 100


I was playing around with the python binding for caché (2018.1.4) and I ran into some problems.

When executing the class query "List" from SYS.Database the pythonbind interface throws an exception, that seems to be caused by a mismatch of the defined SQL datatypes for this query and what is actually returned (or the lack of type conversion in the pythonbind interface).

Is this a known issue ? Are there solutions/workarounds for this,
Or is this a bug ?

The details:

0 4
0 284

It is possible to update Cache object property from Python using the following Python code, with import of intersys.pythonbind3:


However, I am unable to save 2D %List with 2D Python array like the following:


I am not sure whether this is Python-Cache bind flaw or design issue. Is there any alternative/ workaround to do the same for above?

0 3
0 275

Pyodbc supports calling stored procedure , but if the IRIS Stored Procedure ROWSPEC has a column with datatype specified as %Date or %Time, Pyodbc fails to fetch it and throws this error.


pyodbc.Error: (' 2201', '[ 2201] [Cache ODBC][State : 22018 ][Native Code 22005]\r\nERROR #388: Unknown error, code 22005 (22005) (SQLGetData)')


on printing the cursor execute description, pyodbc reads the column as <int>.

0 3
0 471


I'm trying to set Caché-Python Binding on Mac, but there is a problem.

I performed installation and configuration of Caché-Python binding module based on the manual (URL)
including setting of PATH and LD_LIBRARY_PATH in "bash_profile",
and they seems to be done successfully (there was no error in the process).

0 3
0 794

Hello there community,

I am pleased to say that i have started building a product and I have chosen InterSystems technology to be used in it.

But I have a confusion with regard to it.

I actually have to come to a conclusion to whether to use CACHE or IRIS.

I will be using a lot of data and also integrating it along with Python for DEEP and Machine Learning.

Also I do not have an idea of how to get the licensed version of either of that.

0 3
1 220
Scott Fadden · Nov 11, 2020
Create Database using Python
I am trying to create a database using python. The example shows setting a Name string and a Properties object containing Directory=.

; Use class methods to create an instance
 %SYS>s Name="ABC"
 %SYS>s Properties("Directory")="c:\abc\"
 %SYS>s Status=##Class(Config.Databases).Create(Name,.Properties)
 %SYS>i '$$$ISOK(Status) w !,"Error="_$SYSTEM.Status.GetErrorText(Status)

How do I update and pass the Directory property using Python?

0 3
0 184