SQLite的DELETE不工作 [英] SQLite DELETE not working

查看:339
本文介绍了SQLite的DELETE不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用下面的code从我的SQLite表中删除某些行。

I'm using the following code to remove certain rows from my SQLite table.

                if (!cfile.exists()) {// remove invalid db files
                    database.rawQuery("DELETE FROM "
                            + DataBaseHelper.VFS_DATABASE_TABLE + " WHERE "
                            + DataBaseHelper.VIRTUAL_SYSTEM_COLUMN_PATH // TODO
                                                // not
                                                // removing
                                                // properly
                            + " IS ?", new String[] { pathcursora.getString(0) });
                    System.out.println("DELETE FROM "
                            + DataBaseHelper.VFS_DATABASE_TABLE + " WHERE "
                            + DataBaseHelper.VIRTUAL_SYSTEM_COLUMN_PATH
                            + " IS "+pathcursora.getString(0));
                }

但行没有被清除。以下堆栈跟踪:

But the rows are not getting deleted. Stack trace below:

02-28 23:13:27.564: D/NameManager.java(7098): Checking for whatever
02-28 23:13:27.587: I/System.out(7098): 1 : /mnt/sdcard/fsimages87
02-28 23:13:27.587: I/System.out(7098): 2 : /mnt/sdcard/fsimages3
02-28 23:13:27.595: I/System.out(7098): Invalid db entry for /mnt/sdcard/fsimages3 removed.
02-28 23:13:27.595: I/System.out(7098): 3 : /mnt/sdcard/fsimages2
02-28 23:13:27.603: I/System.out(7098): Invalid db entry for /mnt/sdcard/fsimages2 removed.
02-28 23:13:27.603: I/System.out(7098): 4 : /mnt/sdcard/fsimages1
02-28 23:13:27.603: I/System.out(7098): Invalid db entry for /mnt/sdcard/fsimages1 removed.
02-28 23:13:27.603: I/System.out(7098): 5 : /mnt/sdcard/fsimages
02-28 23:13:46.603: D/NameManager.java(7098): Checking for whatever
02-28 23:13:46.618: I/System.out(7098): 1 : /mnt/sdcard/fsimages87
02-28 23:13:46.618: I/System.out(7098): 2 : /mnt/sdcard/fsimages3
02-28 23:13:46.626: I/System.out(7098): Invalid db entry for /mnt/sdcard/fsimages3 removed.
02-28 23:13:46.626: I/System.out(7098): 3 : /mnt/sdcard/fsimages2
02-28 23:13:46.626: I/System.out(7098): Invalid db entry for /mnt/sdcard/fsimages2 removed.
02-28 23:13:46.626: I/System.out(7098): 4 : /mnt/sdcard/fsimages1
02-28 23:13:46.634: I/System.out(7098): Invalid db entry for /mnt/sdcard/fsimages1 removed.
02-28 23:13:46.634: I/System.out(7098): 5 : /mnt/sdcard/fsimages

我在做什么错在这里?

What am I doing wrong here?

推荐答案

(除非你是自动提交模式下),你提交你的事务?

(Unless you're in auto-commit mode) are you committing your transaction?

你检查你的SQL语句的准确性?

Have you checked your SQL statement for accuracy?

这篇关于SQLite的DELETE不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆