Subject | Re: [IBO] Basic Tuturial Errors |
---|---|
Author | Geoff Worboys |
Post date | 2001-01-16T03:05:46Z |
> "Project Tuturial3.exe raised exception class EIB_ISCErrorIf this is the problem I remember being mentioned a while ago; the
> with message 'ISC ERROR CODE: 335544321
> ISC ERROR MESSAGE:
> arithmetic exception, numeric overflow, or string truncation'.
>
> The execution stops on line 828 of IB_Session.pas.
>
> My guess is that the tuturial was not written for IB v6.x
error is in the definition of a database procedure (done in
Tutorial1).
In CREATE PROCEDURE SP_GEN_DUMMY_ITEM
You will find where it is inserting a record, and part of the insert
is a the calculation:
( :P_BAR_PREFIX || ( :P_CATEGORY_ID * ( 100000 + :i ) + :i * 10000 +
:i * 10 + :P_CATEGORY_ID ) )
This is trying to create the barcode for the entry which is domain
T_CODE (VARCHAR(20)). In IB6 integer calculations seem to promoted to
int64 (upto 18 digits). In the displayed calculation, if the int64
result is concatenated to a :P_BAR_PREFIX of more than 2 characters,
IB sees the possibility of overflow (even though it has not happened).
I think you can resolve this by any one of...
- Only supply prefixes of 2 or less characters.
- Increase the size of T_CODE to VARCHAR(24) or more
- Cast the result of the above calculation to VARCHAR(20)
HTH
Geoff Worboys
Telesis Computing