Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Need help converting from objectscript query into Python query

Question
Kevin McGinn · Mar 21, 2022

Need help converting from objectscript query into Python query

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")

That failed stating 'UserListAll' did not exist. Though this did not seem to be correct, I also attempted:

<query>.prepare_class("%SYSTEM.License","UserListAll")

#Python #Caché
Product version: Caché 2018.1

Source URL:https://community.intersystems.com/post/need-help-converting-objectscript-query-python-query