Null field not inserting NULL from empty TEdit
<p>I add new order details to a table in my db.
One of the columns there is named <code>email</code>, in the form I created to add the new order in my delphi application and subsequently the db, I use <code>TEdit</code>s to pass the data along.</p>

<p>This is the code:</p>

<pre><code>procedure TForm2.actAddComandaExecute(Sender: TObject);
begin
if dbmodule.comenziConnection.Connected then
begin
    if addOrderForm.ShowModal=mrok then
begin
    dbmodule.comenziQuery.SQL.Clear;
    dbmodule.comenziQuery.SQL.Add( 'insert into `r33758pi_tipotask`.`comenzi` ( stare, client, telefon, email, detalii, livrare, pret, user, status, observatii ) values ( :stare, :client, :telefon, :email, :detalii, :livrare, :pret, :user, :status, :observatii ) ' ) ;
    dbmodule.comenziQuery.Params.ParamByName( 'stare' ).AsString := addOrderForm.ComboBoxEx1.Text ;
    dbmodule.comenziQuery.Params.ParamByName( 'client' ).AsString := addOrderForm.Edit2.Text ;
    dbmodule.comenziQuery.Params.ParamByName( 'telefon' ).AsString := addOrderForm.Edit3.Text ;
    dbmodule.comenziQuery.Params.ParamByName( 'email' ).AsString := addOrderForm.Edit4.Text ;
    dbmodule.comenziQuery.Params.ParamByName( 'detalii' ).AsString := addOrderForm.Edit5.Text ;
    dbmodule.comenziQuery.Params.ParamByName( 'livrare' ).AsString := addOrderForm.ComboBoxEx6.Text ;
    dbmodule.comenziQuery.Params.ParamByName( 'pret' ).AsString := addOrderForm.Edit7.Text ;
    dbmodule.comenziQuery.Params.ParamByName( 'user' ).AsString := addOrderForm.ComboBoxEx8.Text ;
    dbmodule.comenziQuery.Params.ParamByName( 'status' ).AsString := addOrderForm.ComboBoxEx9.Text ;
    dbmodule.comenziQuery.Params.ParamByName( 'observatii' ).AsString := addOrderForm.Edit10.Text ;
    dbmodule.comenziQuery.ExecSQL ;
end;
end;
end;
</code></pre>

<p>If I leave <code>Edit4</code> empty on the form everything inserts but the field <code>email</code> for that order doesn't have a <code>Null</code> value, it shows just as being empty - not null but no data either. </p>

<p>The column <code>email</code> is set as <code>Null</code> by default in <code>db</code> so that's not the problem.</p>

<p>Screenie from workbench:
<a href="https://i.stack.imgur.com/aruVL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aruVL.png" alt="enter image description here"></a></p>

<p>There should be 2 NULL showing up between the values there but it's just empty.</p>

<p>Any ideas why?</p>

<p>Using Rad Studio 10 Seattle and dbExpress components</p>

<hr>

<p><strong>EDIT</strong></p>

<ul>
<li><strong>comenziQuery</strong> is a <code>TSQLQuery</code></li>
<li><strong>dbmodule</strong> is the name of a <code>data module</code> that holds the db components</li>
<li>the <strong>dataset</strong> is a <code>TSimpleDataSet</code></li>
<li>the <strong>comenziConnection</strong> is the name of a <code>TSQLConnection</code></li>
</ul>

<p>For any future readers, please do read all the answers comments also, great stuff in there. </p>