|
发表于 2013-11-28 17:36:08
|
显示全部楼层
一种方法行不通就换另外一种方法,碰到壁了还可以去旁边找找有没有窗户。
- import sqlite
- var db = sqlite(":memory:")
- if( not db.existsTable("tableName") ){
- db.exec( "CREATE TABLE tableName(
- title PRIMARY KEY,
- length,
- tm
- );"
- )
- }
- db.exec( "REPLACE INTO tableName VALUES ('Silence',11.8,'123')")
- db.exec("
- INSERT OR IGNORE INTO tableName (title,length,tm) VALUES (@title,@length,@tm);
- UPDATE tableName SET tm=@tm",{
- title = "Silence";
- length = 123;
- tm = "456"
- } )
- io.open()
- for title,length,tm in db.each("SELECT * FROM tableName") {
- io.print( title,length,tm )
- }
-
复制代码 |
评分
-
查看全部评分
|