title: How to insert real values into a table using SQL?
body: <p>I'm trying to insert values into the MedicationPrices table with the following code. </p>
  
  <pre><code>procedure TForm1.btnAddMedicineClick(Sender: TObject);
  var
   sMedication, sQuantity : string;
   rPrice : real;
  begin
  sMedication := InputBox('Add Medication','Please enter the medications name','');
  sQuantity := InputBox('Add Medication','Please enter the the quantity','');
  rPrice := StrToFloat(InputBox('Add Medication','Please enter the the price',''));
  
  with dmHospital do
  begin
    qryPrices.SQL.Clear;
    qryPrices.SQL.Add('INSERT INTO MedicationPrices (Medication, Quantity)');
    qryPrices.SQL.Add('VALUES(' + QuotedStr(sMedication) +',' + QuotedStr(sQuantity)  + ' )');
    qryPrices.Parameters.ParamByName('Price').Value := rPrice;
    qryPrices.ExecSQL;
    qryPrices.SQL.Clear;
    qryPrices.SQL.Text := 'SELECT * MedicationPrices ';
    qryPrices.Open;
  end;
  end;
  </code></pre>
  
  <p>However it and a few different variations just don't work. I get:
  <a href="https://i.stack.imgur.com/OKGI4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OKGI4.png" alt="Error message"></a></p>
  
  <p>I don't understand why it doesn't see 'Price' as it is clearly in the table.
  <a href="https://i.stack.imgur.com/9MO0T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9MO0T.png" alt="Design view of table"></a></p>