我如何从一个SQLITE数据库中的数据获取到android中的数组?(How do i get data from an SQLITE database to an array in android?)
很确定这是一件容易的事,但是我将所有将光标返回的数据适配到不同视图的例子感到困惑。 我只想运行一个rawquery,并将返回的每个数据项都放入一个float数组中 (以便我可以稍后添加它们)。 我需要为此使用什么? 谢谢
Pretty sure this is an easy one, but i'm getting confused by all the examples that adapt the data returned from a cursor into different views. I just want to run a rawquery and put each item of data returned into a float array (so that i can add them up later). What do i need to use for this? Thanks
原文:https://stackoverflow.com/questions/4842520
最满意答案
您可能想要运行
rake db:test:prepare
,表格说明不存在于您的测试数据库中。You may want to run
rake db:test:prepare
, the table instructions isn't present in your test database.
相关问答
更多-
我有同样的问题。 要解决这个问题,重新设置数据库是比较容易的。 heroku rake db:reset('heroku run rake db:reset'如果你在雪松上) heroku rake db:migrate('heroku run rake db:migrate',如果你在雪松上) 然后,我的案例移植成功了:) 虽然这在这方面是一个很好的解决方案,但不要在生产中做。 它将从数据库中删除所有记录 I had the same problem. To solve it, resetting the ...
-
也许试试吧 Iosapp.order('updated_at DESC') .where(:user_id => me.id) .where(:payment => 'free') .where(:updated_at => days_ago..present) .select("distinct genre") 此外,我建议针对您在生产中使用的相同数据库进行开发 Maybe try Iosapp.order('updated_at DESC') .where(:user_id => ...
-
问题在于heroku的一面。 他们不得不删除并更新后端的内容。 The problem was on heroku's side. They had to delete and update something on the back end.
-
您可能想要运行rake db:test:prepare ,表格说明不存在于您的测试数据库中。 You may want to run rake db:test:prepare , the table instructions isn't present in your test database.
-
检查您是否在生产数据库上执行迁移。 默认情况下,rake db:migrate使用开发DB。 rake db:migrate RAILS_ENV="production" Check if you are performing migrations on production database. By default rake db:migrate uses development DB. rake db:migrate RAILS_ENV="production"
-
出现此问题的原因是生产数据库上的公寓表缺少列床。 您需要在生产方面进行迁移。 heroku rake db:migrate 查看新列是否出现。 确保你也重启你的heroku。 heroku restart This problem occurs because the Apartment table on production database is missing the column Bed. You need to migrate on production side. heroku rake db: ...
-
您的迁移似乎存在问题。 在本地运行以查看它们是否正常运行: rake db:drop && rake db:create && rake db:migrate PS:我不告诉你运行rake db:reset因为它会加载模式而不是运行迁移。 Finally, I just had to destroy my Heroku app and recreate it. That solved this problem. I didn't have much data in my app. So, I could d ...
-
这个Rails应用程序使用了什么宝石? 您是否在应用程序的根目录中有.gems清单文件,以便heroku自动检测并安装? 我看到你正在使用将paginate gem。 如果你还没有将gems添加到.gems文件中,那我觉得麻烦。 如果你还没有这样做,那么这将是寻求帮助的最佳地点: Heroku | 管理宝石 What all gems are used by this Rails app? Do you have a .gems manifest file in the root of the app fo ...
-
您不需要在heroku上再次运行这些命令。 只需将spree生成的文件添加到git即可。 另外请确保向git添加spree迁移,然后您可以将其部署到heroku上。 其次是 heroku run rake db:migrate You don't need to run these commands again on heroku. Just add the files generated by spree to git. Also make sure to add spree migrations to ...
-
问题是我没有任何迁移(只有schema.rb)。 如果需要,可以删除所有迁移,但如果需要,则需要运行rake db:setup以使用schema.rb来设置数据库(rake db:reset只会查找迁移)。 The issue was that I didn’t have any migrations (only schema.rb). You can remove all migrations if you want, but if you do, you need to run rake db:setu ...