- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
在 SQLite 中是否有 PRAGMA table_info('mytable') 的等效 SELECT 语句?本质上,我想获得与 PRAGMA 返回完全相同的结果集:cid、name、type、notnull、dflt_value 和 pk。虽然我知道通过 C 函数 sqlite3_table_column_metadata 获取此信息的其他替代方法,但我更愿意使用 SELECT 语句。
最佳答案
根据doc
PRAGMAs that return results and that have no side-effects can be accessed from ordinary SELECT statements as table-valued functions. For each participating PRAGMA, the corresponding table-valued function has the same name as the PRAGMA with a 7-character "pragma_" prefix. The PRAGMA argument and schema, if any, are passed as arguments to the table-valued function.
For example, information about the columns in an index can be read using the index_info pragma as follows:
PRAGMA index_info('idx52'); Or, the same content can be read using:
SELECT * FROM pragma_index_info('idx52');
这不应该解决问题吗?
关于sqlite - SQLite 中是否有 PRAGMA table_info ('mytable' ) 的等效 SELECT 语句?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6888581/
在我的 android 应用程序中,当我在执行命令 PRAGMA table_info(table_name)。我该怎么做? 最佳答案 就这么简单(db 是您的 SQLiteDatabase 对象,t
我尝试使用 sqlite3:table_info/2 函数从 sqlite 数据库中提取表信息并收到错误消息。 {ok,Pid} = sqlite3:open(db3). Sql = >. sqlit
我开始学习SQLite,并读到可以使用PRAGMA table_info(table-name)命令获取有关任何表的列信息,而无需在文件中的任何位置指定列名。 PRAGMA如何知道任何特定表需要哪些列
我正在使用用于 Python 的 sqlite3。为什么表达式的参数绑定(bind)不起作用: self.cursor.execute("PRAGMA table_info(?)", table_na
我正在使用 Java 和 SQLiteJDBC与 SQLite 一起工作。我需要访问给定表的列名,我发现可以使用以下命令完成此操作: pragma table_info(myTable) 但是,当尝试
我已经使用 PRAGMA table_info 来获取 ionic 框架中特定表的信息但是当我尝试编译它时我收到错误作为 table_info 的意外标记。但是当我在数据库浏览器中尝试相同的查询时(S
我有一个(至少我这么认为)简单的任务:按列名、数据类型和长度比较 2 个表,只是为了验证它们到目前为止具有相同的结构。它应该在连接到两个不同数据库的现有 perl 脚本中完成。 首先我简单地查询了每个
在 SQLite 中是否有 PRAGMA table_info('mytable') 的等效 SELECT 语句?本质上,我想获得与 PRAGMA 返回完全相同的结果集:cid、name、type、n
我使用以下示例代码并希望以某种方式获取 sqlite3 数据库的列名: using System; using System.Data.SQLite; namespace Program { clas
我是一名优秀的程序员,十分优秀!