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

Home > Can we Import SQL ResultSet into a class ?

Question
Utsavi Gajjar · Jul 12, 2021

Can we Import SQL ResultSet into a class ?

Hello,

I am trying to work out if there are any methods available to be able import a result set returned by SQL query into a persistent class.

I have to connect to some legacy SQL databases through SQL Gateway and run some queries. I need to inster the rows returned into a class to then be able to do a %JSONExport to produce a JSON object.  I know I can iterate through the resultset and insert one row at a time into the class but was wondering if there is any other/direct way of importing the resultset rows into a class.

Regards,

Utsavi

#SQL #InterSystems IRIS for Health
Product version: IRIS 2020.1

Source URL:https://community.intersystems.com/post/can-we-import-sql-resultset-class