on 2022 Dec 07 6:52 PM
Hi all, I want to get multiple select result while executing HanaCommand, but HANA DB throws a error: Sap.Data.Hana.HanaException (0x80004005): sql syntax error: incorrect syntax near "SELECT": line 2 col 1 (at pos 28)
when I'm doing like in the code below. Is it possible to put in there multiple queries to read many results?
using (var con = new HanaConnection(conString))
{
con.Open();
using var cmd = new HanaCommand(@"SELECT COUNT(*) FROM ITEM1;SELECT ID FROM ITEM2;", con);
using var reader = cmd.ExecuteReader();
while (reader.Read())
{
// do stuff
}
reader.NextResult();
while (reader.Read())
{
// do stuff...
}
}
Request clarification before answering.
User | Count |
---|---|
62 | |
8 | |
7 | |
6 | |
6 | |
4 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.