Subject RE: [firebird-support] String truncation errors
Author Thomas Steinmaurer
Tim

> >And, give us an example how you use the stored procedure.
>
> Just calling the stored procedure from IB Console produces the error -
>
> "Select * from ACCOUNTSUMMARY (1, 19);
>
> I have changed all the datatypes of the tables to match each other, and
> also made sure that the SP output parameters match the table datatypes.
>
> I'll remove the quotes and see what happens

Try:

ALTER PROCEDURE "ACCOUNTSUMMARY"
(
"POSID" INTEGER,
"SHIFTNUM" INTEGER
)
RETURNS
(
"RECEIPT" INTEGER,
"RECEIPT2" INTEGER,
"ACC_NUM" VARCHAR(11),
"SUB_CODE" VARCHAR(11),
"MQUANTITY" FLOAT,
"SURNAME" VARCHAR(40),
"SUB_NAME" VARCHAR(25),
"CARD_CODE" VARCHAR(20),
"REGNUM" VARCHAR(10),
"INV_TYPE" SMALLINT,
"INV_PREFIX" VARCHAR(3)
)
AS
BEGIN
FOR SELECT
l.Receipt, l.Receipt2, l.Acc_Num, l.Sub_Code,
SUM(l.MQuantity) AS MQuantity, L.INV_TYPE, L.INV_PREFIX,
c.SurName, s.Sub_Name, s.Card_Code, s.RegNum
FROM
log L JOIN client C
ON
C.code = L.acc_Num
JOIN clnt_sub S
ON
S.code = L.acc_num
WHERE
L.POS_ID = :POSID
AND L.SHIFTNUM = :SHIFTNUM
AND s.sub_code = l.sub_code
GROUP BY l.Receipt, l.Receipt2, l.Acc_Num, l.Sub_Code,
l.inv_type, l.inv_prefix, c.SurName, s.Sub_Name, s.Card_Code,
s.RegNum
ORDER BY c.Surname, l.Acc_Num, l.Sub_Code
INTO
:Receipt, :Receipt2, :Acc_Num, :Sub_Code, :MQuantity,
:inv_type, :inv_prefix, :Surname, :Sub_Name, :Card_Code, :RegNum,
DO
BEGIN
SUSPEND;
END
END


Does this help?

If not, maybe SUM(l.MQuantity) doesn't fit into a FLOAT. Have you tried
using a DOUBLE PRECISION instead of a FLOAT?


--
Best Regards,
Thomas Steinmaurer

The IB LogManager Product Family
Logging/Auditing Suite for InterBase and Firebird
http://www.iblogmanager.com