Hi,
I made a very simple example to reproduce the bug. In Delphi, when adding the fields in Query, the Query automatically detects whether the Field is not null. In Lazarus this is not happening.
Sample in attached.
Thx.

Mailing lists / lazarus / 2011-08
12 messages · 4 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
I made a very simple example to reproduce the bug. In Delphi, when adding the fields in Query, the Query automatically detects whether the Field is not null. In Lazarus this is not happening.
Sample in attached.
Thx.
A best sample in attached.
2011/8/2 silvioprog :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqldb_bug.zip
Type: application/zip
Size: 3724 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110802/edf4d388/attachment.zip>
Hi,
Someone is experiencing this problem?:
http://62.166.198.202/view.php?id=19872
I'm trying to create an OPF, but with this bug still isn't possible to continue implementing my framework.
Thx.
silvioprog wroteI'm trying to create an OPF,
Sorry I can't help with your problem, but I do have a question...
Just curious. Have you tried tiOPF2? This is a OPF with a lot of features and very stable code base - been in production use for many years, by many developers. Not to mention it will save you a boat load of time, instead of implementing a full featured OPF from scratch. Also the GUI bindings work well with Delphi VCL, Lazarus LCL and fpGUI. Just a thought I would mention all this.
If you have tried tiOPF2, but still needed to implement your own OPF. Would you mind sharing why you decided against tiOPF?
Hi Graeme,
2011/8/9 Graeme Geldenhuys :
Sorry I can't help with your problem, but I do have a question...
No problem. ;) It seems to be a bug in fcl-db.
My framework will not have many resources. It will be a very simple framework. It will generate only a few simple SQL scripts, such as select, insert, update, and something with join.
One question, tiOPF is compatible with CGI apps?
Thx.
-- Regards, ? - Graeme -
silvioprog wroteNo problem. ;) It seems to be a bug in fcl-db.
I read the bug report you listed, but haven't taken a look at the sample project attached to that report. I use SqlDB (which falls under the fcl-db umbrella) extensively, but haven't found any major issues. Those that I have found via the extensive test suite of tiOPF has already been addressed. I'll be extending the tiOPF SqlDB support to cover PostgreSQL, MySQL etc in the test suite too - make they will raise some issues (but I hope not). I also want to try out the open source IBX components for FPC.
My framework will not have many resources. It will be a very simple framework. It will generate only a few simple SQL scripts, such as select, insert, update, and something with join.
Maybe you should give tiOPF2 a try after all. For simple SQL, the tiOPF has what is called Auto-Mapping, and can generate all the SQL for you. My projects are a bit more complex, so I manage the SQL myself (with the help of utility apps).
One question, tiOPF is compatible with CGI apps?
Definitely. We have a large product built with tiOPF. It has a Desktop GUI and a CGI Web interface. About 90% of the code is shared between the different frontends because most of the code is non-gui code. We have a good separation between GUI, Business Objects/Rules and Storage (db persistence), so this made things very easy.
2011/8/9 Graeme Geldenhuys :
Good. I use only SQLite and PostgreSQL (in all my apps, desktop or web).
[...]
I'm downloading the sources of tiOPF via SVN. I will do some tests. Any questions I ask again (in the list of tiOPF, sure ;) ).
Thx again. ;)
-- Regards, ? - Graeme -
Someone is experiencing this problem?: http://62.166.198.202/view.php?id=19872 I'm trying…
It is not always possible to detect the required field. Delphi also very often does it wrong. (for instance when you do a join)
That is why sql-db relies on the ProviderOptions property : pfInkey should be set for the keyfield.
This does not exclude that fcl-db should try harder to detect the key field, but you should be aware that it cannot always be detected reliably. (I always specify it manually)
So leave the bug open. But try setting the pfInKey option whenever you can.
Michael.
Someone is experiencing this problem?: http://62.166.198.202/view.php?id=19872 I'm trying…
off the top of my head, without reading the bug report, is this a required field that the database knows about that is expected to tell the application about?
even though i've been doing a lot of this type of stuff for 20+ years, i've not run into this particular situation based on the reading of the posts about it... in my past, anything that was required was required by the coder to handle... in other words, they must know the requirements of the database when they wrote their code so that specific situations like this were covered by their code... yes, this meant "hardcoding" items like this... but many things have changed over the years and this may be one of those... but i am trying to assist when and where i can though many, like yourself, may have more experience than i in some cases like this ;)
I fully agree with this, and this is how I code my projects too.
It is not always possible to detect the required field. Delphi also very often does it…
2011/8/9 Michael Van Canneyt :
Thanks Michael,
After this explanation, I'll prefer inform the Required field manually.
off the top of my head, without reading the bug report, is this a required field that the…
2011/8/9 waldo kitty :
Hi Waldo,
Sorry if I did not understand everything, the translator was not very clear for me. ^^'
Know if the field is Required would be very helpful for me to configure the fields are not null in my views (I use MVC with input in HTML5: http://www.w3schools.com/html5/att_input_required.asp).
But I can put the field not null manually, no problems. ;)
Thx, and sorry if I was not very clear in the translation.