Recordcount error: subquery returned more than 1 value

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
martind1
Posts: 17
Joined: Mon 19 Oct 2009 05:15

Recordcount error: subquery returned more than 1 value

Post by martind1 » Mon 06 May 2013 14:35

Using MS SQL Server I am geting the following message:

"Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <=, >, >=or when the subquery is used as an expression."

opening the following query:

Code: Select all

select SRTE_NR, sum(NETTO_GEWICHT) as SUM_GEWICHT
from BHAE
where (AANL_NR=:AANL_NR)
group by SRTE_NR
or any other query containing a 'group by' clause.

used configuration:
FetchAll:=false;
Options.QueryRecCount:=true;

dbMonitor shows this statement querying recordcount:

Code: Select all

SET :PCOUNT = (SELECT COUNT(*)
from BHAE
where (AANL_NR=:AANL_NR)
group by SRTE_NR)
so you can see the incorrect generated statement.

AndreyZ

Re: Recordcount error: subquery returned more than 1 value

Post by AndreyZ » Mon 13 May 2013 07:36

Thank you for the information. We have reproduced the problem and the investigation of the problem is in progress. We will notify you when we have any results.

tobias_cd
Posts: 56
Joined: Thu 18 Dec 2008 22:10

Re: Recordcount error: subquery returned more than 1 value

Post by tobias_cd » Fri 07 Jun 2013 17:20

Hello Andrey,
are there any news on this issue?
Thank you.

AndreyZ

Re: Recordcount error: subquery returned more than 1 value

Post by AndreyZ » Mon 10 Jun 2013 09:28

We will fix this problem in one of the nearest UniDAC builds.

Post Reply