[Gambas-user] SHELL command with python does not execute!

Doriano Blengino doriano.blengino at ...1909...
Fri Feb 12 10:27:18 CET 2010


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





More information about the User mailing list