Case-sensitivity in SQL binding [message #1405026] |
Wed, 06 August 2014 12:01 |
Dennis Geesen Messages: 46 Registered: June 2014 |
Member |
|
|
Hi,
It is more a disscusible topic than a problem, because I'm aware why and how it is working. However, I often get the same "error", which has to do with the case-sensitivity in the SQL binding.
Following example:
I have a field called "VAT" and the according "getVAT()" and "setVAT()" methods in the form data class.
So, the following call is used to load the data:
SQL.selectInto("SELECT vat FROM ITEMS "
+ " WHERE id = :id "
+ "INTO "
+ ":VAT",
formData);
Since Java ist case-sensitive, I would normally aggree that ":VAT" is the way how to define the bind name, because the methods for VAT are also capitalized.
According to this case-sensitivity, :VAT/getVAT()/setVAT() is not the same like :Vat/getVat()/setVat() or :vat/getvat()/setvat().
That's ok and comprehensible!
However, the following one is working too for getVAT()/setVAT:
SQL.selectInto("SELECT vat FROM ITEMS "
+ " WHERE id = :id "
+ "INTO "
+ ":vAT",
formData);
This is obviously due to the special handling of the first character...
Now my question: why this? It should be either completely case-sensitive or not.
Is there a certain reason fot this special handling?
Since my MySQL instances are running case-insensitive too and fields/propertys with the same name (regardless of the sensitivity) are not a good idea (in my tests there were also some resolving problems when using same fields with different capitalizations), I would appreciate to use also case-insensitivity for SQL binding in Scout (:vat and :VAT are the same). Or switching this on/off would be nice?! Or is this already possible?!
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03665 seconds