[SOLVED] Writing floats to database lazarus / 16-Databases ---------------------------------------------------------------------- madref · 2015-11-03 21:53 i have the following table: Code: [Select]     cSQL := '';     cSQL := cSQL + 'CREATE TABLE tbl_Divisie ';     cSQL := cSQL + '(';     cSQL := cSQL + 'Divisie_ID Word PRIMARY KEY ASC,';     cSQL := cSQL + 'Divisie_Tekst varchar(25),';     cSQL := cSQL + 'Divisie_Gebruiken Boolean,';     cSQL := cSQL + 'Divisie_Volgorde Word,';     cSQL := cSQL + 'Divisie_Voluit varchar(75),';     cSQL := cSQL + 'Divisie_Vergoeding_Ref Float,';     cSQL := cSQL + 'Divisie_Vergoeding_Lmn Float';     cSQL := cSQL + ');';     Connect_RefereeDB.ExecuteDirect(cSQL); and now i am trying to write a record to this table with the following code: Code: [Select]     cSQL := '';     cSQL := cSQL + 'INSERT INTO tbl_Divisies ';     cSQL := cSQL + 'VALUES (1,"(All)",1,1,"All Divisions,0.0,0.0")';     Connect_RefereeDB.ExecuteDirect(cSQL); But the code gives an error with the floating points. How can i write a floating point? ---------------------------------------------------------------------- taazz · 2015-11-03 21:58 Quote from: madref on November 03, 2015, 10:53:46 pmCode: [Select]     cSQL := '';     cSQL := cSQL + 'INSERT INTO tbl_Divisies ';     cSQL := cSQL + 'VALUES (1,"(All)",1,1,"All Divisions,0.0,0.0")';     Connect_RefereeDB.ExecuteDirect(cSQL); But the code gives an error with the floating points. How can i write a floating point? take care where you end your strings in this case you need to move the double quote from the end of the line to the end of the Divisions word, see the highlighted line. 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      cSQL := '';    cSQL := cSQL + 'INSERT INTO tbl_Divisies ';    cSQL := cSQL + 'VALUES (1,"(All)",1,1,"All Divisions",0.0,0.0)';    Connect_RefereeDB.ExecuteDirect(cSQL); ---------------------------------------------------------------------- madref · 2015-11-03 22:04 I saw that error too... But it still gives the same error. it won't write my floats ---------------------------------------------------------------------- taazz · 2015-11-03 22:06 Quote from: madref on November 03, 2015, 11:04:15 pmI saw that error too... But it still gives the same error. it won't write my floats post the complete error message. What you describe is not normal. ---------------------------------------------------------------------- madref · 2015-11-03 22:12 The error is: Project ..... raised exception class 'Unknown'. And when i use the same construction in a different table it works like a charm. Code: [Select]    // tbl_Licenties_Keuze aanmaken     cSQL := '';     cSQL := cSQL + 'CREATE TABLE tbl_Licenties_Keuze ';     cSQL := cSQL + '(';     cSQL := cSQL + 'Licentie_ID Word PRIMARY KEY ASC,';     cSQL := cSQL + 'Licentie varchar(10),';     cSQL := cSQL + 'Licentie_Uitleg varchar(250)';     cSQL := cSQL + ');';     Connect_RefereeDB.ExecuteDirect(cSQL);     // tbl_Licenties_Keuze vullen met de juiste licenties     cSQL := '';     cSQL := cSQL + 'INSERT INTO tbl_Licenties_Keuze ';     cSQL := cSQL + 'VALUES (1,"-","Not applied for a License")';     Connect_RefereeDB.ExecuteDirect(cSQL); ---------------------------------------------------------------------- madref · 2015-11-03 22:16 I found the error. I am creating a table called tbl_Divisie and i am trying to insert into tbl_DivisieS Hence the error