Odd query results

Bob Sneidar bobsneidar at iotecdigital.com
Thu Dec 15 17:38:27 EST 2016


Good idea, except I think I set the primary key columns to unsigned. Also, they have to be unique, so I cannot have more than one unassigned device, which would often be the case.

I may have to alter my schema but of course that cuts the total number of integers I have available in half. Not a big deal though.

Bob S


On Dec 14, 2016, at 18:58 , Mike Kerner <MikeKerner at roadrunner.com<mailto:MikeKerner at roadrunner.com>> wrote:

I'd have to see your SQL, but how are you checking for null and empty?
Null is a funky value in SQL that can mean a variety of things, and an
empty value in an integer column will give you heartache.  WIth many
DBMS's, you have to check IS NULL or IS NOT NULL depending on the column
values and types.  See the syntax reference for the DBMS you are using.  If
I was in your position, 0 would be unassigned and -1 would be
decommissioned, the column would be set to NOT NULL, and a trigger would
set it to 0 if it IS NULL() for insert and for update.




More information about the use-livecode mailing list