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

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 912

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 811

Hi,

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)

p10.run_obj_method("PrintPerson",[])

0 14
0 779

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 724

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 672

I have a table, with autoincremented id

CREATE TABLE users (
    id SERIAL NOT NULL,
    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 11
0 582

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 469

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?

Thanks

0 5
0 458
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 453

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 436

I have table

CREATE TABLE nodes (
        name VARCHAR(50) NOT NULL, 
        parent VARCHAR(50), 
        PRIMARY KEY (name), 
        FOREIGN KEY(parent) REFERENCES nodes (name) ON UPDATE cascade
);

I put some data

INSERT INTO nodes (name, parent) VALUES ('n1', NULL);
INSERT INTO nodes (name, parent) VALUES ('n11', 'n1');
INSERT INTO nodes (name, parent) VALUES ('n12', 'n1');
INSERT INTO nodes (name, parent) VALUES ('n13', 'n1');

Let's delete all

DELETE FROM nodes;

Nope, no way.

SQL Error [124] [S1000]: [SQLCODE: <-124>:<FOREIGN KEY constraint failed referential check upon DELETE of row in referenced table>]
[Location: <ServerLoop>]
[%msg: <At least 1 Row exists in table 'SQLUser.nodes' which references key 'NODESPKey2' - Foreign Key Constraint 'NODESFKey3', Field(s) 'parent' failed on referential action of NO ACTION>]

0 7
0 430

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 382

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

my_object.set("my_property",["A","B","C"])

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

my_object.set("my_property",[["A","B","C"],["1","2","3"]])

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 353
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 333

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 318