易截截图软件、单文件、免安装、纯绿色、仅160KB

如何枚举sqlite中的所有表及其字段??

我有一份sqlite数据库文件,但不知道里面的表名,如何枚举出所有的表名以及其字段名??

关键是sqlite的sql语句如何写?我试了一些sql语句不行,特来求助。


字段名 则无法象表名一样从数据库系统表中直接获得。你只能打开每个表后,遍历其字段。比如使用ADO.recordset打开表后,通过fields.name 得到列名和其它信息(字段定义类型,长度)

或者 在sqlite 中用 .

.schema ?TABLE?        Show the CREATE statements

显示表结构
SQL code:
sqlite> .schema t1
CREATE TABLE t1 (id int primary key, col1 int,col2 int);
sqlite>
sqlite> select sql from sqlite_master where name='t1' and type='table';
sql
CREATE TABLE t1 (id int primary key, col1 int,col2 int)
sqlite>
sqlite> select * from t1;
id|col1|col2
1|1|1
2|2|2
3|3|3






PRAGMA  table_info(表名) 可以得到字段信息


相关问答:

求sql语句,sqlite数据库

电话本匹配查询,希望一条语句搞定
 
假设号码本(numtable)如下:

号码(num)      联系人 (relationname)     
10086          移 ......

怎么让sqlite支持中文,谁解决了就给他100分

怎么让sqlite支持中文,谁解决了就给他100分
难道SQLITE不支持中文吗????????

读取出来时乱码

这样试试
C# code:

using System.Data;
using System.Data.SQLite;
//...
using (SQLiteConnec ......

sqlite数据库不能连续存入数据的问题

我用evc编写的程序,将对话框中的数据存入数据库,第一次可以存入,不过第二次输入的数据不能存入到数据库中。
下面是我的程序
UpdateData(TRUE); // TODO: Add your control notification handler code here ......

SQLite返回的中文记录是乱码

WTL框架使用Unicode字符集
用下面函数插入记录
void CMainFrame::Insert()
{
TCHAR query[MAX_PATH] = {0};
_stprintf(query, _T("insert into correct_word values (\'發\',\& ......

delphi怎样连接Sqlite 增删改查

delphi连接Sqlite 增删改查例子
数据库已经连通了, 插入会报错,no query specified
with dm.ASQLite3Query1 do
  begin
    dm.ASQLite3Query1.Close;
    dm.ASQLite3 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号