首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

Sqlite 小札记

2012-08-19 
Sqlite 小笔记1.如何查询Sqlite 数据库中的所有表信息From within a c/c++ program (or a scritpt using t

Sqlite 小笔记
1.如何查询Sqlite 数据库中的所有表信息
From within a c/c++ program (or a scritpt using tcl/Ruby/Perl/Python bindings),you can get access to table and index names by doing a select on a special table named "SQULITE_MASTER",Every SQLite database has an SQLITE_MASTER table that defines the schema for the database ;

比如:
sqlite> select name from sqlite_master where type='table' order by name;
name = carts
name = line_items
name = orders
name = products
name = schema_migrations
name = sqlite_sequence

>>>>>=======================================
或者直接使用此命令 .tables
或者使用简写 .tab
sqlite> .tables
carts              orders             schema_migrations
line_items         products           users        

2.如何删除Sqlite 数据库中某一张表中的所有数据
命令 delete from table_name;
sqlite > delete from users;

热点排行