Subject Conversion Error From String (Error 3355443)
Author drp90064
Here's a weird one...

I am running FireBird RC2 on Windows 2000. Client application is
written in latest IBO4 using latest gds32.dll. Database is running
Dialect 1.

I have a stored proc which ran just fun until the upgrade from Beta 2
to RC2. This did not help. The problem was that I would receive
a "Conversion Error Form String" error message from the server (ISC
Error Number 3355443) whenever the SP attempted to reference
variables that were declared as NUMERIC(15,2). The only solution I
could find was to cast all of the variable references to NUMERIC
(15,2). Listed below is the "fixed" stored proc. The original one
was exactly the same minus the CAST(xxx as NUMERIC(15,2)) stuff.
Does anyone have a clue why this re-casting of variables that are
already as NUMERIC is necessary?

Here it is:

--=============

CREATE PROCEDURE CASECALC (
ID INTEGER)
AS
DECLARE VARIABLE AIATOTAL NUMERIC(15,2);
DECLARE VARIABLE PAYMENTS NUMERIC(15,2);
DECLARE VARIABLE NUMPMTS INTEGER;
begin
select cast(sum(gross) as numeric(15,2))
from apps
where (apps.caid = :id) and (apps.appstatus = 'z') and
(apps.purchaseprice > 0)
into :aiatotal;

select count(*), sum(pmtamount) from caledger where caid = :id
into :numpmts, :payments;

if (numpmts > 0) then
update cases set taia = cast(:aiatotal as numeric(15,2)),
taiabal = (cast(:aiatotal as numeric(15,2)) - cast(:payments as
numeric(15,2)) ) where caid = :id;
else
update cases set taia = cast(:aiatotal as numeric(15,2)),
taiabal = cast(:aiatotal as numeric(15,2)) where caid = :id;

end

--=================

Thanks,

Dan