Page 1 of 1

problem with stored procedure returning 2 datasets (MySQL 8)

Posted: 31.08.2022, 14:13
by abk964
Second dataset is readable in first call of procedure only.

Procedure DDL:

Code: Select all

CREATE PROCEDURE `TwoDSTest`()
BEGIN
    SELECT * FROM (VALUES ROW(1.1, 1.2), ROW(2.1, 2.2)) as T(f1, f2);
    SELECT * FROM (VALUES ROW(3), ROW(4), ROW(5)) as T2(f3);
END
Test project attached.

Re: problem with stored procedure returning 2 datasets (MySQL 8)

Posted: 05.09.2022, 13:25
by abk964
Solved by changing NextRecordSet (aka NextResultSet) to SetResultSet(1) for second DS.
"Open" does not clean FActiveResultIndex, so it stores from previous call. Have to use absolute value via SetResultSet.