SQLite的"没有ROWID"支持Android上的SQLite的? [英] SQLite "WITHOUT ROWID" supported on Android SQLite?

查看:179
本文介绍了SQLite的"没有ROWID"支持Android上的SQLite的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SQLite的应用程序,使用SQLite的编译自定义(使用NDK)时,在Linux,Windows的Andr​​oid版也能正常工作。创建与无ROWID正常工作表。

I have a SQLite application that works fine on Linux, Windows an also Android when using a custom compiled SQLite (using the NDK). Creating tables with and without ROWID works properly.

在相反的,当我尝试使用Android的标准SQLite的语法错误被抛出近没有在未来的SQL语句来创建相同的模式:

On the opposite, when I try to create the same schema using the standard SQLite in Android a syntax error is thrown near "WITHOUT" in the next SQL sentence:

CREATE TABLE REL_TABLE1_TABLE2
  ( FK_TABLE1_ID integer, FK_TABLE2_ID integer, 
    FOREIGN KEY (FK_TABLE1_ID)   REFERENCES  TABLE1(ROWID),
    FOREIGN KEY (FK_TABLE2_ID) REFERENCES TABLE2(ROWID),
    PRIMARY KEY (FK_TABLE1_ID, FK_TABLE2_ID) 
  ) 
  WITHOUT ROWID;

如果我删除了没有ROWID它工作正常。这是否意味着没有任何ROWID不支持在Android?

If I remove the "WITHOUT ROWID" it works properly. Does it mean WITHOUT ROWID is not supported on Android?.

我没有发现任何相关的文件,但其他人似乎已经相关的问题:

I found no related documentation but someone else looks to have related problems:

<一个href=\"http://stackoverflow.com/questions/27524548/cannot-open-sqlite-database-with-linqpad-when-without-rowid-is-used\">Cannot开放源码数据库linqpad,当不带ROWID使用

编辑:TABLE1 / 2仍然保持ROWID。无ROWID仅适用于N / M REL_TABLE1_TABLE2表

edit: TABLE1/2 still keep the ROWID. WITHOUT ROWID applies only to the N/M REL_TABLE1_TABLE2 table

推荐答案

无ROWID SQLite中介绍3.8.2

WITHOUT ROWID was introduced in SQLite 3.8.2.

这意味着它可能会,也可能不支持在Android上,这取决于的Andr​​oid您正在使用的版本

This means that it might or might not be supported on Android, depending on which Android version you're using.

这篇关于SQLite的&QUOT;没有ROWID&QUOT;支持Android上的SQLite的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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