Multiple recordsets in one stored procedure

I’m looking for a way to iterate through a dataset that should contain multiple recordsets.
I have a stored procedure and it has 6 recordsets that it returns. However, all the code I’ve seen so far only allows for one recordset per call, the first one.

In other languages, you can either reference the table by index from the result or you can do a “Next Result” command and then continue on to the next dataset.

Does that technique not exist in Ignition/Python?

No. Definitely not in the client. In the gateway, you could use native JDBC, thanks to jython’s ability to use Java. You’d have to obtain a connection from the datasource’s pool, use it and return it. I’m not sure how to get the java connection purely in jython, though. /-:


Could you use a different command to bring all the records into a PyDataSet or basic Dataset, then iterate through that dataset? IE use a PrepQuery function rather than a stored procedure?

I know the db functions in Ignition allow this:

Don’t use the Scalar functions as they return only one row.

data = system.db.runPrepQuery(queryString, argsList, ...)

data = system.dataset.toPyDataSet(data) #Possibly unnecessary...

for row in data:
     do something