Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7654357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:14:09+00:00 2026-05-31T12:14:09+00:00

Can the python interface be used to directly access and iterate through an intersystems

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:14:11+00:00Added an answer on May 31, 2026 at 12:14 pm

    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.

    Query OneGlobal(GlobalName As %String) As %Query(ROWSPEC = "NodeValue:%String,Sub1:%String,Sub2:%String,Sub3:%String,Sub4:%String,Sub5:%String,Sub6:%String,Sub7:%String,Sub8:%String,Sub9:%String") [SqlProc]
    {
    }
    
    ClassMethod OneGlobalExecute(ByRef qHandle As %Binary, GlobalName As %String) As %Status
    {
        S qHandle="^"_GlobalName
        Quit $$$OK
    }
    
    ClassMethod OneGlobalClose(ByRef qHandle As %Binary) As %Status [ PlaceAfter = OneGlobalExecute ]
    {
        Quit $$$OK
    }
    
    ClassMethod OneGlobalFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ PlaceAfter = OneGlobalExecute ]
    {
    
        S Q=qHandle  
        S Q=$Q(@Q)  b  
        I Q="" S Row="",AtEnd=1 Q $$$OK
        S Depth=$QL(Q)
        S $LI(Row,1)=$G(@Q)
        F I=1:1:Depth S $LI(Row,I+1)=$QS(Q,I)
        F I=Depth+1:1:9 S $LI(Row,I+1)=""
        S AtEnd=0
        S qHandle=Q
        Quit $$$OK
    }
    

    To access this from python you might use (with pyodbc):

    import pyodbc
    import win32com.client
    import urllib2
    
    class CacheOdbcClient:
    
        connectionString="DSN=MYCACHEDSN"
    
        def __init__(self):
            pass
    
        def getGlobalAsOverlyLargeList(self):
            connection=pyodbc.connect(self.connectionString)
            cursor=connection.cursor()
            cursor.execute("call MyPackageName.MyClassName_OneGlobal ?","MYGLOBAL")
            list=[]
            for row in cursor :
                list.append((row.NodeValue,row.Sub1,row.Sub2,row.Sub3,row.Sub4,row.Sub5,row.Sub6,row.Sub7,row.Sub8,row.Sub9))
            return list
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Python I can use the iterkeys() method to iterate over the keys of
The software tool SWIG can be used to create a programming interface (bindings) to
I know python can be run on GAE what is different erlang and python
Using PyObjC , you can use Python to write Cocoa applications for OS X.
How do you set up IIS so that you can call python scripts from
I need a recommendation for a pythonic library that can marshall python objects to
Let's say I need to use Python and C++. I can call Python function
In python you can use a tuple in a formatted print statement and the
my Python program can be launched with a range of different options (or subcommands)
In python we can use multiprocessing modules. If there is a similar library in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.