apache / apache/arrow-adbc

csharp/src/Client/AdbcDataReader: ability to get multiple result sets while executing multi-statement

Open
#1,447 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.