Benoît Minisini ha scritto: >> >>>>> >>>>> Query to Benoit ... is there a way to define 'NOT NULL' entry via >>>>> gambas code ? >>>>> >>>> You have to define the default value. What's the point of having a >>>> mandatory field (NOT NULL) without a default value? >>>> >>> just say i want something ... but i can't say what because there is >>> not default rules. >>> and then advise the user that he need to say someting by himself >>> >>> for example my age can't be 0 >>> >> A default value does not imply that a value is required, and a "not >> null" clause does not imply a default value. >> >> > > Mmm. You may be right. :-) But that needs some change in the gb.db component > and in all database drivers. > > A general idea could be to add a further optional argument "Flags". Those bit-mask flags could have a name like "db.bNotNull" for flags valid for every database, and names like MySql.bAutoincrement, for example, for flags only valid for certain databases. If, in code, someone uses a feature with the wrong backend, an error is generated by the compiler (unknown symbol). The definition of a field would be, for example:
htable.Fields.Add("AFM", MySql.SpecialInteger, 18, db.bNotNull + MySql.bAutoIncrement) Just an idea. Regards, Doriano ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user