从 sqlite 数据库获取信息模式
我想从当前数据库获取所有表及其列的列表,例如:
table1
- column1
- column2
- column3
table2
- column1
- column2
我尝试过:
SELECT * FROM sqlite_master WHERE type=? ORDER BY name;
(?
is 'table'
)
但我只得到表列表,没有列:(
如果我删除 WHERE 子句,我得到这个错误:
SQLSTATE[HY000]: General error: 25 bind or column index out of range
如果我用 column
替换 table
我什么也得不到......
请帮忙?
I want to get a list of all tables and their columns from the current database, like:
table1
- column1
- column2
- column3
table2
- column1
- column2
I tried:
SELECT * FROM sqlite_master WHERE type=? ORDER BY name;
(?
is 'table'
)
but I get only the table list, without the columns :(
If I remove the WHERE clause I get this error:
SQLSTATE[HY000]: General error: 25 bind or column index out of range
If I replace table
with column
I get nothing...
Help please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试这个查询:
您将得到以下列:
Try this query:
You'll get the following columns: