SQLiteÃüÁîÐгÌÐò˵Ã÷
sqlite3: Ò»¸öSQLiteÊý¾Ý¿âµÄÃüÁîÐнӿÚ
ÒëÕß×¢
ÔÎĵØÖ·£ºhttp://www.sqlite.org/sqlite.html
SQLite¿â°üº¬Ò»¸öÃû×Ö½Ð×ösqlite3 µÄÃüÁîÐÐ,Ëü¿ÉÒÔÈÃÓû§ÊÖ¹¤ÊäÈë²¢Ö´ÐÐÃæÏòSQLiteÊý¾Ý¿âµÄSQLÃüÁî¡£±¾ÎĵµÌṩһ¸öÑùʹÓÃsqlite3µÄ¼òҪ˵Ã÷¡£
¿ªÊ¼
Æô¶¯sqlite3 ³ÌÐò£¬½ö½öÐèÒªÇÃÈë´øÓÐSQLiteÊý¾Ý¿âÃû×ÖµÄ"sqlite3 "ÃüÁî¼´¿É¡£Èç¹ûÎļþ²»´æÔÚ£¬Ôò´´½¨Ò»¸öеģ¨Êý¾Ý¿â£©Îļþ¡£È»ºósqlite3 ³Ì
Ðò½«ÌáʾÄãÊäÈëSQL¡£ÇÃÈëSQLÓï¾ä£¨ÒԷֺœ£»”½áÊø£©£¬Çûسµ¼üÖ®ºó£¬SQLÓï¾ä¾Í»áÖ´ÐС£
ÀýÈ磬´´½¨Ò»¸ö°üº¬Ò»¸ö±í"tb11"Ãû×ÖΪ"ex1"µÄSQLiteÊý¾Ý¿â£¬Äã¿ÉÒÔÕâÑù×ö£º
$sqlite3 ex1
SQLite version 3.3.17
Enter ".help" for instructions
sqlite> create table tbl1(one varchar(10), two smallint);
sqlite> insert into tbl1 values('hello!', 10);
sqlite> insert into tbl1 values('goodbye', 20);
sqlite> select * from tbl1;
hello!|10
goodbye|20
sqlite>
Äã¿ÉÒÔͨ¹ýÇÃÄãËùÓÃϵͳµÄÎļþ½áÊø·û£¨Í¨³£ÊÇCtrl + D£©»òÕßÖжÏ×Ö·û£¨Í¨³£ÊÇCtrl + C£©¡£À´ÖÕÖ¹sqlite3³ÌÐò¡£È·¶¨ÄãÔÚÿ¸öSQLÓï¾ä½áÊøÇÃÈë·ÖºÅ£¡
sqlite3³ÌÐòͨ¹ý²éÕÒ·ÖºÅÀ´¾ö¶¨Ò»¸öSQLÓï¾äµÄ½áÊø¡£Èç¹ûÄãÊ¡ÂԷֺţ¬sqlite3½«¸øÄãÒ»¸öÁ¬ÐøµÄÃüÁîÌáʾ·û²¢µÈÄã¸øµ±Ç°µÄSQLÃüÁîÌí¼Ó¸ü¶àµÄÎÄ×Ö¡£Õâ¸öÌØ
µãÈÃÄãÊäÈë¶àÐеĶà¸öSQLÓï¾ä£¬ÀýÈ磺
sqlite> create table tbl2(
...> f1 varchar(30) primary key,
...> f2 text,
...> f3 real
...> );
sqlite>
ÌâÍâ»°£º²éѯSQLITE_MASTER±í
SQLiteÊý¾Ý¿âµÄ¿ò¼Ü±»±£´æÔÚÒ»¸öÃû½Ð"sqlite_master"µÄÌØÊâµÄ±íÖС£Äã¿ÉÒÔÏñ²éѯÆäËü±íÒ»Ñùͨ¹ýÖ´ÐГSELECT”²éѯÕâ¸öÌØÊâµÄ±í¡£ÀýÈ磺
$ sqlite3 ex1
SQlite vresion 3.3.10
Enter ".help" for instructions
sqlite> select * from sqlite_master;
type = table
name = tbl1
tbl_name = tbl1
rootpage = 3
sql = create table tbl1(one varchar(10), two smallint)
sqlite>
µ«Äã²»ÄÜÔÚsqlite_master±íÖÐÖ´ÐÐÖîÈçDROP TABLE, UPDA
Ïà¹ØÎĵµ£º
@ǶÈëʽ¹ØϵÐÍÊý¾Ý¿âSQLite
Ìصã
1.Ö§³ÖÎåÖÖÊý¾ÝÀàÐÍ null,INTEGER,REAL(¸¡µãÊý),TEXT(×Ö·û´®Îı¾)ºÍBLOB£¨¶þ½øÖÆÎı¾£©Êý¾ÝÀàÐÍ£¬ËäÈ»
ËüÖ»ÓÐÎåÖÖ£¬µ«Êµ¼ÊÉÏsqlite3Ò²½ÓÊÖvarcher(n),char(n),decimal(p,s)µÈÊý¾ÝÀàÐÍ£ ......
±¾ÎÄÒÔÊý¾Ý¿âÖеÄÊý¾Ý±íUserInfoΪʵÀýչʾÊý¾Ý¿â±íµÄ´´½¨¼°Êý¾Ý¼Ç¼µÄ¼Èë¡£
#!/bin/sh
#variables definition
#database location
db=/conf/db
#
#create table userInfo
#name: User name
#passwd: Password
#Privilege: User privilege -- Administrator:0 Operator:1
#
echo "create table UserInfo(n ......
AutoIt3¿ª·¢µÄ²Ù×÷SQliteÊý¾Ý¿âµÄÔ´ÂëÏÂÔØ
²¿·ÖÔ´Âë
_SQLite_Startup () ;¼ÓÔØ SQLite.dll
If Not FileExists($SQLite_Data_Path) Then
SQLCreate()
EndIf
$GUI_Form = GUICreate($Title, 300, 435, -1, -1)
GUISetBkColor(0xECE9D8) ; will change background color
$GUI_ListBox = GUIC ......
[±à¼±¾¶Î
]
SQLite¼ò½é
SQLite
µÚÒ»¸öAlpha°æ±¾µ®ÉúÓÚ2000Äê5ÔÂ. ÖÁ½ñÒѾÓÐ10¸öÄêÍ·ÁË. SQLiteÒ²ÓÀ´ÁËÒ»¸ö°æ±¾ SQLite 3ÒѾ·¢²¼.
¡¡¡¡SQLiteÊÇÒ»¿îÇáÐ͵ÄÊý¾Ý¿â£¬ÊÇ×ñÊØACIDµÄ¹ØÁªÊ½Êý¾Ý¿â¹ÜÀíϵͳ£¬ËüµÄÉè¼ÆÄ¿±êÊÇǶÈë
ʽµÄ£¬¶øÇÒÄ¿Ç°ÒѾÔںܶàǶÈëʽ²úÆ·ÖÐʹÓÃÁËËü£¬ËüÕ¼ÓÃ×ÊÔ´·Ç³£µÄµÍ£¬ÔÚǶÈëʽÉ豸ÖУ¬¿ ......
SQLiteÊý¾Ý¿âÁ¬½Ó·½Ê½
SQLite.NET
Type: .NET Framework Class Library
Usage: System.Data.SQLite.SQLiteConnection
Basic
Data Source=filename;Version=3;
Version 2 is not supported by this class library.
Using UTF16
Data Source=filename;Version=3;UseUTF16 ......