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

Unity3d ÖÐÎÄÊäÈëÊä³ö ²éѯsqliteÊý¾Ý¿â

CnGuiDB.js
var db : dbAccess;
public var mskin : GUISkin;
private var mstring : String;
var inputStr;
function Start(){
inputStr = "1";
}
function search(mid)
{
db = new dbAccess();
db.OpenDB("db1.db");
var tableName = "myTable";
// table name, I want to return everyone whose first name is Bob when their last name is = to Sagat, this returs an array
var resultArray = db.SingleSelectWhere(tableName, "name", "id", "=", mid); // Remember the '' on String values
mstring=resultArray[0];
print(mstring);
// of course you can loop through them all if you wish
db.CloseDB();
}
function OnGUI()
{
GUI.skin=mskin;
inputStr =GUI.TextField(new Rect(200, 154, 200, 30),inputStr,25);
if(GUI.Button(new Rect(400,154,60,30),"search"))
{
search(inputStr);
}
GUI.Label(new Rect(10,400,400,900),mstring);
}
±à¼­Ä£Ê½ db1·ÅÔÚ¹¤³Ì×ÜĿ¼Ï£¬Óëassets\library\tempͬ¼¶
exe²¿Êð db1·ÅÔÚ¿ÉÖ´ÐÐÎļþͬ¼¶
sqlite²ÎÕÕ£º
http://forum.unity3d.com/viewtopic.php?t=30249&start=0&postdays=0&postorder=asc&highlight=
ÖÐÎÄÊäÈëÊä³ö²ÎÕÕ£º
http://bbs.vrchina.net/viewthread.php?tid=11357
http://bbs.vrchina.net/viewthread.php?tid=11636&extra=page%3D1
sqlite¹ÜÀí¹¤¾ß
http://img.newhua.com/softinfo/90240/


Ïà¹ØÎĵµ£º

SQLite²Ù×÷Ö¸ÄÏ(SQLite version 3.6.21)

1¡¢.back ?DB? FILE  ±¸·ÝDB(ĬÈÏΪmain)µ½Îļþ
2¡¢.bail ON|OFF  Óöµ½Ò»¸ö´íÎó¿ÛÍ£Ö¹£¬¸ÃֵĬÈÏΪOFF
3¡¢.databases  Áоٸ½¼Óµ½Êý¾Ý¿âµÄÊý¾Ý¿âÃûºÍÎļþÃû
4¡¢.dump ?TABLE? ...  ÓÃSQLÎı¾¸ñʽÁоÙÊý¾Ý¿â£¬Èç¹ûÖ¸¶¨TABLE£¬½ö½öÁоÙÆ¥ÅäµÄ±í£¬LIKEÀàÐÍTABLE
5¡¢.echo ON|OFF  ÉèÖÃechoµÄ״̬ ......

SQLITEÈëÃÅ Öð²½½²½âSQLITEÃüÁîÐÐ(ËÄ)

.dump ?TABLE? ... ÒÔSQLÓï¾ä·½Ê½ÏÔʾ±íµÄ½á¹¹¡£È磺
sqlite> .dump websties
BEGIN TRANSACTION;
COMMIT;
sqlite> .dump websites
BEGIN TRANSACTION;
CREATE TABLE [websites] (
[WebID] INTEGER NOT NULL PRIMARY KEY,
[WebName] VARCHAR(20) NULL
);
INSERT INTO "websites" VALUES(1,'CTOChina.net'); ......

SqliteºÍSQLCEÔÚWindows Mobile 6ÉϵÄÐÔÄܶԱÈ

     ×î½ü¹«Ë¾ÐèÒª½«×ÀÃæϵͳ²¿Êðµ½PDAÉÏÃæÈ¥£¬Ñ¡ÔñÁËWM6×÷Ϊ²¿Êðƽ̨¡£ÔÚÑ¡ÔñÊý¾Ý¿â·½Ãæ³öÏÖÁËÒ»µã¹ËÂÇ£¬ÒòΪ¶ÔÓÚPDA¶øÑÔ£¬ÐÔÄÜÊÇÊ×Òª¿¼ÂǵÄÒòËØ¡£
     ÔÚ¿ªÔ´µÄÊý¾Ý¿âSqliteºÍSQLCEÖ®¼äÅÇ»²£¬ËùÒÔÕë¶ÔÕâ¸öÇé¿ö£¬¶ÔSqliteºÍSQLCEÔÚWM6ÉÏÃæ×öÁËÐÔÄܲâÊÔ¡£ÎÒÒ²½«×Ô¼ºÔÚ×ö²âÊÔ¹ý³ÌÖÐÅöµ ......

SQLITEÊý¾Ý±íÖ÷¼üÉèÖÃId×ÔÔö·½·¨

    ¸ã¶¨ÁËÒ»¸öÀ§ÈÅÐí¾ÃµÄÎÊÌ⣬ԭÀ´sqliteÖеÄÖ÷¼üÒ²ÊÇ¿ÉÒÔÉèÖÃΪ×ÔÔöµÄ£º£©·½·¨¾ÍÊÇÉùÃ÷Ϊ INTEGER PRIMARY KEY µÄ×ֶοÉÒÔ×Ô¶¯Ôö¼Ó¡£
    ÍøÉϲ鵽×ÊÁÏ˵£¬´Ó SQLite µÄ 2.3.4 °æ±¾¿ªÊ¼£¬Èç¹û½«Ò»¸ö±íÖеÄÒ»¸ö×Ö¶ÎÉùÃ÷Ϊ INTEGER PRIMARY KEY£¬ÄÇôֻÐèÏò¸Ã±íµÄ¸Ã×ֶβåÈëÒ»¸ö NULL Öµ£¬ ......

SQLiteÖ§³ÖµÄÊý¾ÝÀàÐÍ(ÈÕÆÚº¯Êý)


SQLiteÇý¶¯Ö§³ÖµÄSQL ÁÐÀàÐÍ
ÀàÐÍÃèÊö
TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB, BYTEA
²»ÏÞÖƳ¤¶ÈµÄ×Ö·û´®ÀàÐÍ. ¶þ½øÖÆÊý¾Ý±ØÐ밲ȫµØ±àÂë´æ´¢, ¼ûtextÀàÐÍ.
CHAR(), VARCHAR(), TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT
²»ÏÞÖƳ¤¶ÈµÄ×Ö·û´®ÀàÐÍ. ²»»á±»½Ø¶Ï»òÕßÌî³ä
ENUM
²»ÏÞÖƳ¤¶ÈµÄ×Ö·û´®ÀàÐÍ. ²»Ïñ MySQL, ʹÓà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ