db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <rick.hille...@gmail.com>
Subject Re: can't get warning 01003 in nested select in update
Date Sun, 17 May 2015 23:35:31 GMT
On 5/16/15 7:25 AM, Bryan Pendleton wrote:
>> 3, when the select in an update statement, can't get the warning 01003.
>> ij(CONNECTION1)> UPDATE APP.EMP T1 SET SALARY = ( SELECT AVG ( T2 . 
>> SALARY ) FRO
>> M APP.EMP T2 ) WHERE WORKDEPT = 'D21' AND SALARY < ( SELECT AVG ( T3 
>> . SALARY )
>> FROM APP.EMP T3 );
>> 7 rows inserted/updated/deleted
>
> The lack of the warning seems incorrect to me. But I'm not sure if this
> behavior is governed by the SQL Standards or not.
>
> thanks,
>
> bryan
>
>
>
Nulls are ignored when computing aggregates, but they should cause the 
statement to raise a warning, as specified in the 2011 SQL Standard, 
part 2, section 10.9 (aggregate function), General Rule 6a. I don't see 
anything in the Standard which absolves the UPDATE statement of its 
responsibility to report a warning encountered during the processing of 
an aggregate. So, I agree. This looks like a bug to me.

Please feel free to log a bug.

Thanks,
-Rick

Mime
View raw message