<div dir="ltr">2013/9/11 LacaK <span dir="ltr"><<a href="mailto:lacak@zoznam.sk" target="_blank">lacak@zoznam.sk</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<u></u>
<div bgcolor="#ffffff" text="#000000">
silvioprog wrote / napísal(a):
Now doing more tests. I see, that in pgAdmin when I use right click on
table and use "View Data" then '' (two single quotes) are shown in TEXT
column, but when I use SQL and type:<br>
select * from <table name> then empty fields are shown ... so it
seems to me, that bug is in pgAdmin, does not ?<br>
-Laco.</div></blockquote><div><br></div><div>The bug is in FCL. Please see the steps in my comparison:</div><div><br></div><div>1. first I inserted a record via pgAdmin: insert into test (id, fieldtext) values (1, null);</div>
<div>2. after, I executed this demo: <a href="http://pastebin.com/HS8DZkDV">http://pastebin.com/HS8DZkDV</a>;</div><div>3. finally, I made this selection in pgAdmin:</div><div> select * from test</div><div> where fieldtext is null;</div>
<div><br></div><div>And the result is:</div><div><br></div><div>id | fieldtext</div><div>-----------------</div><div>1 |</div><div><br></div><div>But, when I select so:</div><div><br></div><div><div>select * from test</div>
<div>where fieldtext = ''</div></div><div><br></div><div>The result is:</div><div><br></div><div><div>id | fieldtext</div><div>-----------------</div><div>2 |</div></div><div><br></div><div>Then SQLdb is saving an empty string instead of null. :o</div>
<div><br></div><div>I tried it:</div><div><br></div><div>q.FieldByName('fieldtext').Value := Null;<br></div><div><br></div><div>Instead of:</div><div><br></div><div>q.FieldByName('fieldtext').Clear;<br></div>
<div><br></div><div>Same result, it is saving an empty string instead of null.</div><div><br></div></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>