csharp/src/Client/AdbcDataReader: ability to get multiple result sets while executing multi-statement
- Dominant language
- C#
- Stars
- 627
- Forks
- 217
- Avg merge
- 17h
- Merged PRs (30d)
- 57
Description
For example, while executing multi-statement: “DROP TABLE IF EXISTS TESTTABLE;CREATE TABLE TESTTABLE(intcol INT);INSERT INTO TESTTABLE VALUES (123);INSERT INTO TESTTABLE VALUES (456);SELECT * FROM TESTTABLE WHERE INTCOL=123;SELECT * FROM TESTTABLE WHERE INTCOL=456;SELECT * FROM TESTTABLE WHERE INTCOL=456;DROP TABLE TESTTABLE;”
We can get a result in AdbcDataReader like this:
“Multiple statements executed successfully.”
Meanwhile, ADO.NET driver or ODBC driver able to get 2 result sets from 2 SELECT queries, like this:
INTCOL
123
INTCOL
456
This capability should be achieved via reader.NextResult() and reader.Read(), sample code as below:
do
{
while (reader.Read())
{
//read data into result set
}
yield return resultSet;
} while (reader.NextResult());
Contributor guide
Assessment
This issue has not been assessed yet.