Lazarus SQLQuery BCDField problem with Firebird lazarus / 63-Database ---------------------------------------------------------------------- dogriz · 2018-04-25 17:14 When I try to save value 999999999 into Firebird database field - decimal(15,2) from Lazarus application, value -844674408,37 is saved instead. Used components are IBConnection, SQLQuery and DBEdit. I made a simple example using employee database - just added one test field: Code: [Select]alter table EMPLOYEE add TEST_FIELD decimal(15,2) Sample application is attached. Does anyone know why is this happening? Saving the same number (999999999) using isql or FlameRobin works as expected. BTW, Lazarus 1.8.2/FPC 3.0.4 on Windows 10 64bit + Firebird 3.0.3 64bit. ---------------------------------------------------------------------- valdir.marcos · 2018-04-25 18:00 Try with Numeric or BigInt: https://firebirdsql.org/file/documentation/reference_manuals/fblangref 25-en/html/fblangref25-datatypes-fixedtypes.html https://firebirdsql.org/refdocs/langrefupd25-bigint.html ---------------------------------------------------------------------- dogriz · 2018-04-25 18:33 I just tested it on Linux + Lazarus/FPC trunk and it works OK. Just don't know why it misbehaves on Win + 1.8.2/3.0.4 Update: I crosscompiled from Linux + Lazarus/FPC trunk to Windows and when I run the app on Win, it doesn't work OK... ---------------------------------------------------------------------- valdir.marcos · 2018-04-25 23:29 I am using Lazarus 1.8.2, FPC 3.0.4, Firebird 2.5 on Windows 7 Pro 64 bits. Results are identical on both Lazarus and FlameRobin. See the attached image. Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i CREATE TABLE TestBigNumbers(  ID            INTEGER NOT NULL PRIMARY KEY,   Field_Decimal DECIMAL(15,2),   Field_Numeric NUMERIC(15,2),   Field_BigInt  BIGINT  );Commit; INSERT INTO TestBigNumbers(ID, Field_Decimal, Field_Numeric, Field_BigInt) VALUES (1, 999999999, 999999999, 999999999);Commit; SELECT * FROM TestBigNumbers; Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);begin  SQLQuery1.SQL.Clear;  SQLQuery1.SQL.Text := 'Insert Into TestBigNumbers(ID, Field_Decimal, Field_Numeric, Field_BigInt) ' +                        'Values (2, 999999999, 999999999, 999999999);';  SQLQuery1.ExecSQL;  SQLTransaction1.Commit;  ShowMessage('OK');end; ---------------------------------------------------------------------- valdir.marcos · 2018-04-26 00:08 I have changed your project to work with my clean database and it worked correctly. I even changed from Firebird 2.5.8 to 3.0.3 and no error. See image. Is your fbclient.dll on version 3.0.3? Instead of using Employee.fdb, create a new database. Maybe, start another sample project from zero...