Can the python interface be used to directly access and iterate through an intersystems cache global, or does python simply expose the same "tables" I see when I use a linked server or ODBC Connection?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
There are 2 types of Cache access in Python -- ODBC connection (you will see your tables) and Python binding (you will see your classes). You may create a class which will iterate through Cache globals if you want and then use it from Python binding. There is a documentation on Python binding in Cache. http://docs.intersystems.com/cache20111/csp/docbook/DocBook.UI.Page.cls?KEY=GBPY
If you want to directly access globals you can create a stored procedure that will do so. You should consider the security implications before you do this - it will expose all data in the global to anyone with ODBC access.
Here is an example of a stored procedure that returns the values of up to 9 global subscripts, plus the value at that node. You can modify it pretty easily if you need to.
To access this from python you might use (with pyodbc):