gpt4 book ai didi

sqlite - 在 livecode 中从数据库中的数据网格中保存多个 hilited 行

转载 作者:行者123 更新时间:2023-12-05 01:17:39 25 4
gpt4 key购买 nike

我有 在 Livecode 中创建了一个 sqlite 表

put "CREATE TABLE Chapter(ID INTEGER, Units TEXT, UUID INTEGER)" into 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 行。

But,My Question is that I want to save more than one row in Units column of my table upon multiple hilited rows in datagrid.




请建议是否有任何其他方法可以从数据库中的数据网格中保存多行。

最佳答案

请在以下链接中找到一个示例堆栈,该堆栈允许您将数据网格的多个高亮行保存到 SQLite 数据库。为了创建这个堆栈,我修改了 LiveCode SQLite 数据库类(class)中提供的示例——

http://techsupport.on-rev.com/test/Sqlite_Example.livecode

我不得不稍微修改您从 Row datagrid 代码中的选择,因为我在复制和粘贴时收到编译错误。

希望这会给你一些线索。

关于sqlite - 在 livecode 中从数据库中的数据网格中保存多个 hilited 行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19269897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com