我在 Livecode 中创建了一个 sqlite 表
将“CREATE TABLE Chapter(ID INTEGER, Units TEXT, UUID INTEGER)”放入 tSQL
revExecuteSQL tDatabaseID, tSQL
从 Datagrid 代码中选择行:
put the dgData of group "DataGrid 1" into tData1
put the dgHilitedLines of group "DataGrid 1" into tIndexes
repeat for each item tIndex in tIndexes
put tData1[tIndex]["Unit"] into theUnit
put "Insert into Chapter(ID,Units,UUID) values('15','"theUnit"','5');" into tSQL
revExecuteSQL tDatabaseID, tSQL
end repeat
上面的代码在数据库中只保存了一个 Hilited 行。
但是,我的问题是,我想在 datagrid 中的多个 hilited 行上在我的表的 Units 列中保存不止一行。
请建议是否有任何其他方法可以从数据库中的数据网格中保存多行。