Skip to Content
0
Former Member
Oct 19, 2013 at 04:37 PM

ODBC- How to fetch more than one resultset?

183 Views

Hi,

I am trying to migrate MS SQL Server code to HANA. We create add hoc queries where we generate multiple SQL SELECT statements.

I tried to run two simple SELECT statements but ODBC driver returned error while preparing. I tried ExecuteDirect and it failed complaining about semicolon (statement terminator).

If I run those two statements from HANA developer studio I see that it parses text and executes them one by one.

Zdenko

PS

Test can be done with two simple selects:

SELECT 1 FROM DUMMY;

SELECT 2 FROM DUMMY;

I refer to:

SQLMoreResults Function

http://msdn.microsoft.com/en-us/library/ms714673(v=vs.85).aspx

Once it is done with the first result set, the application calls SQLMoreResults to move to the next result set. If another result set or count is available, SQLMoreResults returns SQL_SUCCESS and initializes the result set