Is this a bug or ..?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Senad
Posts: 34
Joined: Tue 10 Dec 2013 08:07

Is this a bug or ..?

Post by Senad » Wed 09 Aug 2017 11:55

I use multiple select statements in a sql server stored procedure.
The sp runs ok on the server.
However when dropping your UniStoredProc1 on a form and linking it to
my sp on the server only the first field can be retrieved.
Example (this is the server sp):

Code: Select all

ALTER PROCEDURE [dbo].[sp_skupaj]
	AS
BEGIN
	  
select COUNT(dieta) as SKUPAJ_NAVADNA from STANOVALCI where NADSTROPJE in ('0 L','0 D') and dieta ='1';
select COUNT(dieta) as SKUPAJ_PASIRANA from STANOVALCI where NADSTROPJE in ('0 L','0 D') and dieta ='2';
select COUNT(dieta) as SKUPAJ_SLADKORNA from STANOVALCI where NADSTROPJE in ('0 L','0 D') and dieta ='3';

END
However, your UniStoredProc1 is only returning the first select count statement (SKUPAJ_NAVADNA). Other 2 are ignored.
Why ?

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

Re: Is this a bug or ..?

Post by ViktorV » Thu 10 Aug 2017 08:52

TUniStoredProc allow working with multiple results returned by a stored procedure using the OpenNext method. Call of the OpenNext method will return the following result set if only the TUniStoredProc.SpecificOptions.Values['SQL Server.DisableMultipleResults'] property is set to 'False' (by default).

Post Reply