Hi all,
I am trying to execute a query like the below code.
set statement = ##class(%ResultSet).%New("some_class:query_method"). // here query method is empty and with rowspec some columname

statement.Execute(param1)

I want to fetch data type of column value returned from above. eg - Name - VARCHAR, amount - INTEGER etc.
How can I get it. Or if not possible directly. Is there any other way to validate or get datatype of values returned. Line we have type() in python3

0 5
0 300

All,

I've asked my teammate to open a WRC on this issue, but wanted to open the discussion to see if maybe we aren't the first people to see this issue.

The code we are deploying is a COS object with some Python methods. The code works fine locally on the developer's machine. However, when the business process runs in the server environment, we see the following when COS code attempts to call a [Language = python] method:

0 5
0 211

Hi everyone,

I'm attempting to compile a basic Python code on a remote server, but it appears that the compiler doesn't recognize the language.

The remote server is running a virtual machine with Oracle Linux Server 7.9 (64-bit), and it has IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2021.1 (Build 215U) [HealthConnect:3.3.0] installed.

When I try to compile a script that includes a Python ClassMethod, such as this "testpy.cls":

0 4
0 150

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 440

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 72

import os

# Get environment variables
db_host = os.getenv('DB_HOST')
db_port = os.getenv('DB_PORT')
db_namespace = os.getenv('DB_NAMESPACE')
db_username = os.getenv('DB_USERNAME')
db_password = os.getenv('DB_PASSWORD')

# Create a database connection
conn = irisnative.createConnection(db_host, db_port, db_namespace, db_username, db_password)

# Create an IRIS instance from this connection
iris_native = irisnative.createIris(conn)

status = iris_native.classMethodValue('%SYSTEM.OBJ', 'Load', 'Production.cls', 'ck')

0 3
0 135

I have an existing Python script that opens a child session using the pexpect library. But currently all it does is send hard-coded commands to the Cache process and expect a hard-coded response back in order to continue in the script.

I would like to run a Cache routine from the script, pass in a parameter, and wait for a response that will be different every time (a date, in this case). So the call would be something like D $$Tag^Routine(parameter) and wait for the routine to complete and return the response.

0 3
0 270

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 357

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 821

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

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
· 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 230

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

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 184

Using the below python script I am getting :

$ ./hello_world.py
Traceback (most recent call last):
File "/home/wwillett/dev/vscode-objectscript/Samples-python-helloworld/./hello_world.py", line 34, in <module>
run()
File "/home/wwillett/dev/vscode-objectscript/Samples-python-helloworld/./hello_world.py", line 21, in run
connection = irisnative.createConnection(ip, port, namespace, username, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: * [ERROR_SEQUENCE_ERROR]

1 2
0 85

Hi all,

Does anybody have the same issue?

$ZF(-100) to run python script not work when directly execute in studio or in storedproc called by TrakCare, but can work when do in iris session.

The python script imports a "barcode" package. It seems that when directly execute in studio or in storedproc called by TrakCare, the package can not be imported.

1 2
0 88

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 292

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 251