Subject | [firebird-support]Numeric Aggregates problem in EXECUTE STATEMENT |
---|---|
Author | Paul Hope |
Post date | 2006-04-07T11:56:18Z |
Hi
There seems to be a problem with EXECUTE STATEMENT
<1>
this fails (c.dentist_amount is numeric(9,2))
DENAMT NUMERIC(9,2)
sqlstring='Select c.dentist,sum(c.dentist_amount) from '||:collectname||' c
group by c.dentist';
for execute statement sqlstring into :den,:denamt do
begin suspend; end
with error
'Unsuccessful execution caused by unavailable resource. Variable type
(position1) in execute statement... does not match return.'
<2>
but this works
sqlstring='Select c.dentist,cast(sum(c.dentist_amount)as numeric(9,2)) from
'||:collectname||' c group by c.dentist';
for execute statement sqlstring into :den,:denamt do
begin suspend; end
<3>
and this works
for select c.dentist,sum(c.dentist_amount) from CR22005 c group by c.dentist
into :den,:denamt do
begin suspend; end
so shouldn't the casting in <2> be an automatic under the hood thing like it
appears to be in <3> so that <1> would work?
Regards
Paul
[Non-text portions of this message have been removed]
There seems to be a problem with EXECUTE STATEMENT
<1>
this fails (c.dentist_amount is numeric(9,2))
DENAMT NUMERIC(9,2)
sqlstring='Select c.dentist,sum(c.dentist_amount) from '||:collectname||' c
group by c.dentist';
for execute statement sqlstring into :den,:denamt do
begin suspend; end
with error
'Unsuccessful execution caused by unavailable resource. Variable type
(position1) in execute statement... does not match return.'
<2>
but this works
sqlstring='Select c.dentist,cast(sum(c.dentist_amount)as numeric(9,2)) from
'||:collectname||' c group by c.dentist';
for execute statement sqlstring into :den,:denamt do
begin suspend; end
<3>
and this works
for select c.dentist,sum(c.dentist_amount) from CR22005 c group by c.dentist
into :den,:denamt do
begin suspend; end
so shouldn't the casting in <2> be an automatic under the hood thing like it
appears to be in <3> so that <1> would work?
Regards
Paul
[Non-text portions of this message have been removed]