Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¹ØÓÚsqliteÖ´ÐÐʱ¼äµÄÒÉÎÊ£¿

Êý¾Ý¿âÖÐÓÐÒ»¸öusers±í¡£
create table users(name text, number text);
Ñ­»·²åÈëÒ»°ÙÌõ£¬²»Ê¹ÓÃÊÂÎñµÄ»°£¬ÔÚÎҵĻúÆ÷ÉÏÐèÒª6s¡£ 
¶øÔÚÎÒÅóÓѵĻúÆ÷ÉÏÕâÑùµÄ²Ù×÷»¨·Ñ²»µ½1s¡£ 

¿ÉÄÜÊÇÄÄ·½ÃæµÄÔ­Òòµ¼ÖÂÕâÑùµÄ²îÒ죿
ϵͳµÄ²»Í¬£¬sqlite°æ±¾µÄ²»Í¬»òÊDZàÒëÆ÷µÄ²»Í¬£¿

C/C++ code:

sqlite3* pHandle = 0;
int nOpenRet = sqlite3_open("/home/test.db", &pHandle);
//ouput_time();
int i = 0;
char sExec[256] = {0};
snprintf(sExec, 255, "insert into users values('user', '1');");
char* pErrMsg=0;
for (; i < 100; i++)
{
if (sqlite3_exec(pHandle,sExec, 0, 0, &pErrMsg)!= 0)
{
printf("sqlite execute fail, i=%d\n", i);
return 0;
}
}



ÒýÓÃ

Äã»úÆ÷µÄÓ²ÅÌËٶȡ£

ллÄãµÄ»Ø¸´¡£

ÎÒÅóÓѵĻúÆ÷ͬÎÒµÄÅäÖö¼Ò»Ä£Ò»Ñù£¬ËùÒÔ¿ÉÒÔÅųýÕâÀàÎÊÌâ¡£


ÒýÓÃ
ÅäÖÃÒ»ÑùµÄ»°£¬Ó¦¸Ã¸ú²Ù×÷ϵͳÒÔ¼°±àÒëÆ÷µÄ°æ±¾ÓйØϵ¡£100ÌõÊý¾Ý£¬Ó¦¸ÃÏ൱¿ìµÄ


ÎÒÔÚÆäËûÁ½Ì¨»úÆ÷ÉÏÔËÐйý,һ̨ϵͳºÍÎÒµÄÒ»Ñù¶¼ÊÇubuntu.²»¹ý±àÒëÆ÷ÓõIJ»Í¬,
ËûÊÇʹÓÃemacs.
Ö»ÊǾõµÃ±àÒëÆ÷Ôì³ÉÕâÑùµÄ²îÒìÊDz»ÊÇÓÐЩ¿äÕÅ?



ÕÒµ½Ô­ÒòÁË,ºÍϵͳµÄÎļþϵͳ¸ñʽ²îÒìÓйØ.
ÔÚext3 ºÍext4ÉϵIJ»Í¬.
лл¸÷λ»ØÌû


Ïà¹ØÎÊ´ð£º

sqlite ¸ßÊÖ½øÀ´°¡

СµÜ Ūµã¶«Î÷¿ÉÊǵ÷Óà sqlite3_prepare Õâ¸öº¯Êý select ¾ÍºÃʹ Ö»Òª ¸Ä±äÊý¾Ý¿â µÄ¾Í²»ÐÐ ±ÈÈçinsert Ö®ÀàµÄ Ë­À´°ï¸öæ°¡ ÇëÎÊÕâÊÇʲôԭÒò °¡ Óà c ȥʵÏÖµÄ
ÄãÓõÄʲô¹¤¾ß°¡?
°ÑÄã×Ô¼ºµÄ´úÂë·¢ ......

sqlite ×Ö¶ÎĬÈÏÖµµÈÓÚidÖµ

sqlite ÖÐ
CREATE TABLE table1 (
id integer primary key autoincrement,
name text default '',
[index] integer default ROWID
)

ÓÐûÓÐÀàËƵŦÄÜ£¬Èà index µÄֵĬÈϵÈÓÚid£¬ ......

sqlite dinstincÎÊÌâ

ΪʲôÓÃselect name,distinct phone from phone_book¾Í˵Óï·¨´íÎó£¬
      ÓÃselect distinct phone,name from phone_book¾Í¿ÉÒÔ£¿
ûÓÐΪʲô distinct ÊÇ select µÄÐÞÊηû£¬Ö»ÄÜÔÚ select ºóÖ ......

sqlite ÎÞ·¨¸ù¾ÝGuid ²éѯÊý¾Ý

GUID£º0C3EDEE8-B14F-4220-8D64-990E00D84AF7

SELECT fldGuid, fldName, fldUserGuid from table
Äܲéѯ fldUserGuid Ϊ£º0C3EDEE8-B14F-4220-8D64-990E00D84AF7 µÄÊý¾ÝÒ»Ìõ

SELECT fldGuid, fldN ......

wince 5.0 ¿ª·¢sqliteÊý¾Ý¿âµÄÎÊÌâ



ÓÃevc±àдӦÓóÌÐò£¬¿ª·¢Êý¾Ý¿â¹ÜÀíϵͳ¡£ÉèÖÃencodingΪUTF-8£¬Äܹ»²åÈëÖÐÎÄÊý¾Ý£¬ÓÃSQLite Expert Personal¿´Êý¾Ý¿â£¬ÖÐÎÄÕý³£¡£±ðµÄ³ÌÐò²éѯÊý¾Ý¿â£¬²¢ÏÔʾÓÚEDIT¿Ø¼þÖУ¬Õý³£¡£µ«ÊÇʹÓÃlist control ¿Ø¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ