1。sqlite判斷數據表存在用到的Sql語句 SELECT COUNT(*) asCNT FROM sqlite_master where type='table' and name='DBInfo' //其中DBInfo為需要判斷的表名。注意大小寫敏感! Count:=Query1.Fields[0].AsInteger; //將CNT傳給變數Countend--Anony專注的力量成就夢想
㈡ sqlite 怎樣查詢附加資料庫
$ sqlite3 test.db
sqlite> create table testtb (id integer not null primary key,
...> ch char(1));
sqlite> insert into testtb (ch) values ('a');
sqlite> insert into testtb (ch) values ('b');
sqlite> select * from testtb;
1|a
2|b
sqlite> .q
$ sqlite3
sqlite> attach "test.db" as testdb;
sqlite> select * from testdb.testtb;
1|a
2|b
sqlite> .q
$
㈢ sqlite3查詢容量大小以及每條數據大小
sqlite是文件型的資料庫,所有的東西,都在一個文件中,故支持由對應的硬碟文件系統和操作系統來決定
下面是原文解釋支持的大小:
Every database consists of one or more "pages". Within a single database, every page is the same size, but different database can have page sizes that are powers of two between 512 and 65536, inclusive. The maximum size of a database file is 2147483646 pages. At the maximum page size of 65536 bytes, this translates into a maximum database size of approximately 1.4e+14 bytes (140 terabytes, or 128 tebibytes, or 140,000 gigabytes or 128,000 gibibytes).
㈣ ios sqlite3 怎樣查看資料庫
IOS8以前版本, 如果是模擬器的話, 在這個路徑中找到你的應用: /Users/你的用戶名/Library/Application Support/iPhone Simulator/5.1/Applications/應用目錄 IOS8在以下路徑中找到你的應用 /Users/username/Library/Developer/CoreSimulator/Dev...
㈤ sqlite3資料庫查詢、索引
selectCOUNT(*)
fromSHTwflFault_Info
whereAct_Time_sec>1318212419andAct_Time_sec<1381370820
and(startStn_id=2orendStn_id=2)
groupbyFltLine_id
可以在Act_Time_sec上建索引
第2個sql同第1個,只是後面多了個limit
㈥ 如何通過命令行窗口查看sqlite資料庫文件
1、找到AndroidSDK目錄下的platform-tools文件夾,會發現該目錄下有一個adb.exe文件。到系統環境變數出去設置Path的值,將 adb.exe 所在的路徑加進去。
2、在命令行窗口輸入:" adb shell " 進入控制台
3、輸入 " cd /data/data/包名.項目名稱(小寫)/databases/ " (如: cd /data/data/com.keqi.test/databases/)進入項目文件所在的存儲路徑
4、可通過" ls "命令去查看該目錄下的文件
5、輸入" sqlite3 + 資料庫名.db " (如: " sqlite3 BookStore.db ") 打開資料庫
6、可輸入 " .table " 查看資料庫中存在哪些表
7、可輸入" .schema ' 查看建表語句
8、通過SQL查詢語句 " select * from 表名 " (如:" select * from Book ")
㈦ 如何使用命令行查看內嵌資料庫SQLite3
【1】在Android程序中,一般創建的資料庫存放在 /data/data/[應用程序包名]/databases 的目錄下。
【2】cd 命令:文件夾跳轉命令。ls 命令:查看某個文件夾下面有哪些文件。
【3】使用 "sqlite3 [資料庫名稱] " 命令來對某資料庫進行一系列的操作。
【4】在經過第【3】步驟後,可以使用 .tables 命令查看某資料庫中包含哪些表。若要查詢某表中包含的數據,在 sqlite> 命令後輸入查詢的SQL語句即可查詢,但要注意的是要以分號[;]來結束該語句的輸入。
【5】若在命令行中輸入 adb shell 後,提示:adb不是內部或外部命令,也不是可運行的程序,或批處理文件,遇到這種情況是由於環境變數沒有設置好的問題導致的。解決方法:在安裝的android sdk 包目錄下的找到adb工具所在目錄,一般是在...\android-sdk-windows\tools目錄或者在...\android-sdk-windows\platform-tools目錄下。把該目錄添加到path環境變數中就OK了。
㈧ 如何查看android 手機上sqlite3資料庫
Android是有自帶的類庫的:SQLiteOpenHelper,使用的時候繼承這個類,然後寫邏輯就可以,一般使用單例模式:
public synchronized static DBHelper getDBHelper(Context context) {
if (helper == null) {
helper = new DBHelper(context);
}
return helper;
}
private DBHelper(Context context) {
super(context, "自己的資料庫名", null, 資料庫版本);
}
使用的時候也很簡單,下面是一個刪除操作:
public synchronized void deleteSite(String packname) {
SQLiteDatabase db = getWritableDatabase();
try {
db.beginTransaction();
db.delete("site", "packname=?", new String[] { packname });
db.setTransactionSuccessful();
} finally {
db.endTransaction();
if (db != null) {
}
}
}
㈨ 怎麼看sqlite3資料庫內容
在sqlserver2008中的菜單欄有一個按鍵「顯示關系圖窗格」,這個就是顯示關系圖的鍵。選中一個表,然後點擊這個鍵即可查看關系表。要查看相互表間的關系的話,把其他表拖進窗口即可。
㈩ sqlite3 怎麼查詢資料庫中所有的表 用C語言實現
SELECT name FROM sqlite_master
WHERE type='table'
ORDER BY name;
在C語言中用這個查詢語句