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

Benoît Minisini gambas at ...1...
Thu Feb 11 15:23:55 CET 2010


> sql = "CREATE TABLE Aplianikis ("
>         "aa BIGINT(20) NOT NULL auto_increment,"
>         "Eponimia VARCHAR(40) NOT NULL,"
>         "AFM  VARCHAR(18) NOT NULL,"
>         "Hmerominia DATE NOT NULL,"
>         "Checkbox TINYINT(1) NOT NULL,"
>         "primary key(aa)"
>         ")"
>         "DEFAULT CHARSET=utf8"
> 
> DB.Exec(sql)
> 
> gambas version :
> 
>  Dim htable As Table
>   htable = db.Tables.Add("Aplianikis")
> 
>   htable.Fields.Add("aa", db.Serial, 10)
>   htable.Fields.Add("Eponimia", db.String, 40)
>   htable.Fields.Add("AFM", db.String, 18)
>   htable.Fields.Add("Hmerominia", db.Date)
>   htable.Fields.Add("Checkbox", gb.Boolean,, False)
>   htable.PrimaryKey.Add("aa")
> 
>   htable.Update
> 
> 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?

-- 
Benoît Minisini




More information about the User mailing list