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()
conn.connect_now(.....)

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 191

Hi,

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 442
Question
· Jan 29, 2022
Calling Python Class Methods

Hi,

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 466
Question
· 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 254

Is there a way to automatically transform Object Script arrays to Python lists? This code results in a list of arrays

Iter0 =  dbnative.iterator("HS.Data.OIDMapD")
for subscript, value in Iter0.items():
    print(f"subscript={subscript}, value={value}")

Here is the result:

subscript=1, value=2.16.840.1.113883.3.86ISCInterSystems Corporation

I suppose it would be too hard to parse this into a list, I was just wondering if there was a function provided to make it convenient and proper.

Thanks,

Marlin Mixon

0 2
0 185

Hello,

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?

http://docs.intersystems.com/cache20102/csp/docbook/DocBook.UI.Page.cls?...

0 6
0 153

I was interested in accessing IRIS (Healthshare) using Python. I found instructions how to this here: https://github.com/intersystems/quickstarts-python/tree/master/Solutions...

The installation went well using pip and when python executes "import irisnative" it works fine. It just fails with a connection timeout when I try "irisnative.createConnection(...)." Below is my code:

0 3
0 224
Question
· Jan 27, 2020
IRIS supports of Python and C++

I cannot find those folders under my IRIS install dev folder. Those were in my cache install dev folder.

Will InterSystems drop those support? If yes, why are there some discussion about Python/Iris in this forum?

Of course, I wish IS continue to support those.

0 23
0 1.3K
Question
· 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 232
Question
· 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 205

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 253
Question
· 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 339

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 823

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 233

Hello,

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 920

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:

curl.trillworks.com/#python

My code so far:

0 15
0 385

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 729