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 796

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 198

Hi - has anyone successfully used the python binding on a mac. I carried out the install instructions per InterSystems documentation and it fails completely. 204 warnings and 9 errors. Obviously this was never tested by InterSystems. Is it even worth pursuing?


0 5
0 465

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 849

I have a python script that is pulling the cache instance key expiration date ( KeyExpirationDate() ) which comes back as an integer. With the queryscript function - $ZDATE(73284) I can derive the actual expiration date. Is there a manner or method of creating an equivalent Python script that will convert the integer return by the KeyExpirationDate() method into a date string?

0 1
1 240

So, I know that I can return a SQL Error message from my SQL Procedure written in ObjectScript, with code like this

$ cat <<EOF | irissqlcli iris://_SYSTEM:SYS@localhost:1972/USER
 SET %sqlcontext.%SQLCODE = 400
 SET %sqlcontext.%ROWCOUNT = -1
 SET %sqlcontext.%Message = "test error message"

CALL test();

[SQLCODE: <-400>:<Fatal error occurred>]
[Location: <SPFunction>]
[%msg: <test error message>]

But I did not find how to do it with Python. I can't find %sqlcontext variable available there

0 1
0 178

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 282

In article


Traceback (most recent call last):
File "c:\Users\rochesterd\PythonScripts\fhir_stuff\fhir-client-python-main\fhir-client-python-main\src\client.py", line 57, in <module>
patient0 = Patient.parse_obj(patients_resources.search(
AttributeError: 'NoneType' object has no attribute 'serialize'

0 8
0 202

I am sending an httpRequest from ObjectScript to a python server. I am not receiving a response in OS

OS config On the client side

// Create an HTTP request object
Set httpRequest = ##class(%Net.HttpRequest).%New()

// Set the server URL
Set httpRequest.Server = ""

// Set content type to JSON
Set httpRequest.ContentType = "application/json"

0 5
0 160

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 743
· Sep 9, 2020
Build Python bind

I'm testing with an application I'm writing in python.
But I noticed that the pythonbind3 library will only work on the same machine where the cache is running. Is there really such a dependency?

I'm trying to run the examples that are in the / dev / python / samples3 folder, but they only work if I set "LD_LIBRARY_PATH" with the path to the cache installation folder.

But... I have this error when LD_LIBRARY_PATH is empty:

0 1
0 351

I have developed a process that pulls data elements from a cache instance using the tools provided with the "intersys.pythonbind3" import. This is a windows box. After validating the process, the next step is to install the process on a site (Windows) that does not have an installed version of cache and access the cache instance remotely. But, since intersys.pythonbind3 is part of the cache install, I am not sure what to do to allow this process to function because of the missing import.

0 1
0 355


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 931

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 255

I have the object query:

s Rset=##class(%ResultSet).%New("%SYSTEM.License.UserListAll")

I can loop through that query and it generates the report information that I need.

I have a Python process where I use the intersys import to connect to the Cache instance. But I have been unable to determine the correct syntax in Python for this query. Being that 'UserListAll' is a query I attempted to user:

res = <query>.prepare("select * from %SYSTEM.License_UserListAll")

0 2
0 299

I want to connect IRIS system as it has all the database tables. on top of that I am creating a REST API in python. How can I connect to IRIS DB. here is my example code for connection

def connect():

connection_string = "localhost:1972/USER"

username = "_SYSTEM"

password = "SYS"

conn = iris.connect(connection_string, username, password)

after this connection is created but how can I get tables data. Please let me know more about how we can integrate IRIS database into a python REST API.

0 1
0 221

Using VECTOR_COSINE() in SQL query to perform a text similarity search on existing embeddings in a %VECTOR column.

Code is below.

Commented out sql query returns this error: SQLCODE: -29 Field 'NEW_EMBEDDING_STR' not found in the applicable tables^ SELECT TOP ? maxID , activity , outcome FROMMain .AITest ORDER BY VECTOR_COSINE ( new_embedding_str ,

Sql query as written returns ERROR #5002: ObjectScript error: <PYTHON EXCEPTION> *<class 'OSError'>: isc_stdout_write: PyArg_ParseTuple failed!

0 10
0 152

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 398

I am writing a Python tools I want to access the %Monitor.System.License properties:

  1. AvailableDist
  2. AvailableLocal
  3. MaxUsedDist
  4. MaxUsedLocal
  5. CurrentUsedDist
  6. CurrentUsedLocal

Initially I want to develop Objectscript to verify access to the properties. But I can not figure the proper syntax.

I first attempted:

set ans = ##class(%Monitor.System.License).AvailableDist

which failed.

I tried another approach:

set ans = ##CLASS(%Monitor.System.License).%GetParameter("AvailableLocal")

0 2
0 255

After running many tests to kick the tires calling Python from COS (which worked fine) in any directory, I encountered problems when trying to access Python libraries like Numpy from any OTHER namespace. I saw some other posts about this but the resolution seems unclear. When I run the test program method numpytest below in %SYS it works just fine. If i run the Python method in any other namespace I get:

PITT>do ##class(test.python).numpytest()
DO ##CLASS(test.python).numpytest()
<OBJECT DISPATCH> *python object not found

0 4
0 89
· Oct 27, 2020
Configure IRIS using Python

I am trying to configure IRIS using python. The first task I wanted to do it change the journal directory. I cannot figure out the right way to work with the Config.Journal class with python. I can get the text to query the current setting.

returnValue = dbnative.classMethodValue("Config.Journal","GetList")
print(returnValue )

But I don't see a straightforward way to parse the $List returned by GetList() I was hoping there was an easier way.

How do I

1. Query configuration parameters?

2. Set configuration parameters?

Using python?

0 2
0 211

When looking at the "Current License Usage Summary" web page, there is a line for both local and distributed "Maximum Connections". I have scrutinized every class that seems reasonable to contain this information but have found nothing that matches the values on the web page. I do not believe these are related to license specifically though I did review all of the potential attributes of the license related classes to no avail.

0 2
0 308
· 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 236