Subject Re: [IBO] SQL Insert Error
Author Helen Borrie
At 04:09 p.m. 22/09/2013, John W. (Jack) Cane wrote:


>After numerous successful inserts into FireBird using the same code and TIB_dSQL, FB just issued an error, apparently(?) unhappy with a float number, which was obtained by division of two integers. The query text reads as follows:
>
>'Insert into Images(FileName, Color, Aspect, Genus, Species) Values(''L1161616-2.jpg'',''Red'',0.804753839969635,''Phragmipedium'',''longifolium hybrid Sorcerers Apprentice'') returning kImage'
>
>Delphi runtime error message is:
>
>"First chance exception class EIB_ISCError with message 'ISC ERROR CODE:35544321
>
>"ISC ERROR MESSAGE: arithmetic exception, numeric overflow, or string truncation string right truncation"
>
>All SQL data types are varchar except the third column (float).
>
>If anyone can show me how to fix this, would be grateful.

You'll need to include a CAST expression on the data for that float field.

Realise also that the number that will be stored in a FLOAT (single precision number) will have 9 digits, of which *at most* 7 will be in any way reliable.

Helen