Android SQLite 查询并使用游标处理多行
我有一个查询(我正在使用 rawQuery()
),
SELECT * FROM <table>
然后我使用游标存储它返回的内容。从他们看来,我想做的是,从第一行开始,所以..cursor.moveToFirst()然后逐列获取每一列并将其特定值存储在变量中。然后我想移动到下一行并执行相同的操作。所以我想我的问题是如何让光标处理多列?
谢谢,
I've got a query, (I'm using rawQuery()
)
SELECT * FROM <table>
I'm then storing what it returns using a cursor. From their what I want to do is, start at the first row so.. cursor.moveToFirst()
then take each column , column by column and store its particular value in a variable. I then want to move onto the next row and do the same. So I guess my question is How would I get cursor to deal with multiple columns?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能在这里遗漏了一些东西,难道你没有嵌套循环吗?
外循环循环遍历每条记录:
内循环循环遍历每一列
I might be missing something here, wouldn't you have a nested loop.
The outer loop cycles through each records:
and the inner loop would cycle through each column