Stored Procedure return

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
m227
Posts: 75
Joined: Mon 06 Aug 2007 12:41

Stored Procedure return

Post by m227 » Wed 24 Jun 2015 08:54

Dear Sirs,

I have my stored procedure, inside among others i have two SELECT statemets.
The first one is just to loop through records and execute my other function for each of them. The result is irrelevant. The second SELECT is to return message about execution.

When I call procedure from MySQL Workbench or from terminal, I get my message as a result.
When I call it from delphi through TMyQuery, the result consists of first SELECT result.

What to do to obtain the result of second SELECT (as in MySQL clients)?


Michal

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Stored Procedure return

Post by ViktorV » Thu 25 Jun 2015 09:57

When working with several result-sets in one query, you can work with them sequentially, one by one. This means, that when you are opening TMyQuery, you will get the first result-set. To access the next result-set, you should call the TMyQuery.OpenNext method. See more details about this method in the MyDAC help: http://www.devart.com/mydac/docs/?devar ... next().htm

Post Reply