bbip 发表于 2009-8-31 10:53:48

求助!关于sqlite问题

我写了个sqlite的操作自定义函数代码如下
Func SQLCreate()
    _SQLite_Open ($SQLite_Data_Path)
    _SQLite_Exec(-1, "Create Table IF NOT Exists thank (name Text PRIMARY KEY, ip Text, mac Text , ttime default getdate());")
    _SQLite_Close ()
EndFunc

我的想法是在创建表的同时 能记录表的创建日期,所以用了getdate()函数返回系统当前时间 但是运行的时候出错错误提示如下:

--> Function: _SQLite_Exec
--> Query:    Create Table IF NOT Exists thank (name Text PRIMARY KEY, ip Text, mac Text , ttime default getdate());
--> Error:    near "(": syntax error


后来我改成插入数据的时候 记录插入时间   sql语句如下

    _SQLite_Exec(-1, "UPDATE thank SET ttime = getdate() WHERE name = '" & $a & "';")

结果又有如下错误提示

--> Function: _SQLite_Exec
--> Query:    UPDATE thank SET ttime = getdate() WHERE name = '11';
--> Error:    no such function: getdate

我初学sql   不知道是代码错了还是 sqlite不支持 getdate()函数??
页: [1]
查看完整版本: 求助!关于sqlite问题