Android SQLite 创建具有加密列名的表
我在尝试在 Android 上为 sqlite3 运行 CREATE TABLE 语句时遇到问题。这是因为我正在尝试加密数据库的列。有谁知道为什么它不接受加密值作为列名?
这是我收到的错误:
10-27 17:46:34.591: E/Database(697): Failure 1 (unrecognized token:
338268F19CB9A68A39035AB5D733F931") on 0x232d40 when preparing
'CREATE TABLE db_table (_id INTEGER PRIMARY KEY,
BB2BFFB83A95C39D864C9A52D5A5E2CC TEXT,338268F19CB9A68A39035AB5D733F931
EXT,916D636E4793AB190F05F4F1EF6273A8 TEXT,
UNIQUE(BB2BFFB83A95C39D864C9A52D5A5E2CC) ON CONFLICT ABORT);'.
如果有任何建议,我将不胜感激。谢谢!
I'm running into issues trying to run a CREATE TABLE statement for sqlite3 on Android. This is because I'm trying to encrypt the columns of the database. Does anyone know why it won't accept the encrypted values as column names?
Here is the error that I receive:
10-27 17:46:34.591: E/Database(697): Failure 1 (unrecognized token:
338268F19CB9A68A39035AB5D733F931") on 0x232d40 when preparing
'CREATE TABLE db_table (_id INTEGER PRIMARY KEY,
BB2BFFB83A95C39D864C9A52D5A5E2CC TEXT,338268F19CB9A68A39035AB5D733F931
EXT,916D636E4793AB190F05F4F1EF6273A8 TEXT,
UNIQUE(BB2BFFB83A95C39D864C9A52D5A5E2CC) ON CONFLICT ABORT);'.
I'd appreciate any suggestions. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不带引号的列名不允许以数字开头
Unquoted column names are not allowed to start with a digit
用单引号将 # 引起来,它将起作用:
http://www.sqlite.org/lang_keywords.html
surround your # with single quotes, and it'll work:
http://www.sqlite.org/lang_keywords.html