找回密码
 加入
搜索
查看: 1475|回复: 0

求助!关于sqlite问题

[复制链接]
发表于 2009-8-31 10:53:48 | 显示全部楼层 |阅读模式
我写了个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()函数??
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-22 21:22 , Processed in 0.076631 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表