I try use this code to get mutil select from stored procedure but I can’t:
>$connection = ConnectionManager::get('default');
> $stmt = $connection->execute($query)->getInnerStatement();
> $results = [];
> do {
> try {
> $results[] = $stmt->fetchAll(\PDO::FETCH_OBJ);
> } catch (\Exception $ex) {
> }
> } while ($stmt->nextRowset());
I get an error: Call to undefined method Cake\Database\Statement\SqlserverStatement::nextRowset(), and then I try the same in Cake\Database\Statement\PdoStatement->fetchAll() function like this:
> $stmt = $this->_statement;
> $results = [];
> do {
> try {
> $results[] = $stmt->fetchAll(PDO::FETCH_ASSOC);
> } catch (\Exception $ex) {
> }
> } while ($stmt->nextRowset());
I got an error: Error: No ODBC error was found, but I installed ODBC driver 13 for SQL Server 2014.
How do I get multil select from stored procedure SQL Server?