使用数字的表名的 SQLite 问题? [英] SQLite issue with Table Names using numbers?

查看:64
本文介绍了使用数字的表名的 SQLite 问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,它要求用户从微调器中选择格式如下 1992-1993 的年份.表名也被命名为 1992-1993,其想法是使用 SQL 从这个表中的值通过像这样的语句select * from 1992-1993 来完成.但是,当我运行模拟器时,它会引发错误.

I'm developing an app which requires that the user selects a year formatted like this 1992-1993 from a spinner. The tablename is also named 1992-1993 and the idea is that using SQL the values from this table are pulled through with a statement like this select * from 1992-1993. When I run the emulator however, it throws an error.

如果我然后将 Spinner 项重新标记为 NinetyTwo 并将表重命名为 NinetyTwo 并运行模拟器,它会按预期运行,然后从表中提取数据.

If I then relabel the Spinner item to NinetyTwo and rename the table to NinetyTwo and run the emulator it runs as expected and the data is pulled through from the table.

SQLite 是否存在表名中的数字问题?

Does SQLite have an issue with numbers in table names?

推荐答案

是和否.表名开头的数字有问题.1992-1993 是一个返回 -1 的表达式.尝试将表重命名为 Year1992.

Yes and No. It has an issue with numbers at the beginning of a table name. 1992-1993 is an expression returning -1. Try to rename the table to Year1992.

此处关于 SO 的类似问题.

Here a similar issue on SO.

这篇关于使用数字的表名的 SQLite 问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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