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

SQLiteÓô¥·¢Æ÷À´Ìæ´úÍâ¼üÔ¼Êø

SQLiteÓô¥·¢Æ÷À´Ìæ´úÍâ¼üÔ¼Êø CREATE TABLE [Category] (
  [Pkid] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL,
  [CategoryName] NVARCHAR(32)  NOT NULL,
  [CategoryGuid] char(36)  UNIQUE NOT NULL,
  [CategoryDesc] nvarchar(256)  NULL
) CREATE TABLE [Product] (
  [Pkid] INTEGER  PRIMARY KEY AUTOINCREMENT NOT NULL,
  [CategoryPkid] INTEGER  NOT NULL,
  [ProductName] nvarchar(32)  NULL,
  [ProductPrice] NUMERIC(19,4) DEFAULT '0.00' NOT NULL
)   --InsertÔ¼Êø
CREATE TRIGGER FK_Product_CategoryPkid_Insert
BEFORE Insert ON Product
FOR EACH ROW BEGIN
  SELECT RAISE(ROLLBACK,'No this categoryPkid in category')
  WHERE (SELECT Pkid from Category WHERE Pkid = NEW.CategoryPkid) IS NULL;
END --UpdateÔ¼Êø
CREATE TRIGGER FK_Product_CategoryPkid_Update
BEFORE Update ON Product
FOR EACH ROW BEGIN
  SELECT RAISE(ROLLBACK,'No this categoryPkid in category')
  WHERE (SELECT Pkid from Category WHERE Pkid = NEW.CategoryPkid) IS NULL;
END


Ïà¹ØÎĵµ£º

2010ÄêSQLiteѧϰ±Ê¼ÇÖ®Ò»


2010ÄêSQLiteѧϰ±Ê¼ÇÖ®Ò»
Ò»£®            ÈçºÎ»ñÈ¡SQLite×îа汾
¹Ù·½Õ¾µã£ºhttp://www.sqlite.org/
´Óhttp://www.sqlite.org/ÍøÕ¾µÄDownloadÒ³Ãæ»ñÈ¡
¼´ÈçÏÂÒ³ÃæÏÂÔØ
http://www.sqlite.org/download.html
¶þ£®WindowsϵÄSQLiteµÄÔ´´úÂëÊÇÄĸöÈí¼þÑ¹Ë ......

SQLite ³õ̽

»¹Êdzõ̽£¬×öµÄÏîÄ¿ÒªÓõ½ÇáÇɵı¾µØÊý¾Ý¿â£¬ÓÚÊÇÕÒÁË sqlite 3 ÊÔÓÃÖ®£¬»¹²»´í£¬¹»ÇáÇÉ¡£
ÉÏÕâ¶ùÈ¥ÏÂÔسÌÐòºÍ²é¿´Îĵµ£º http://www.sqlite.org/download.html
Õâ»Ø¿ª·¢ÓõÄÊÇ C#£¬ÓÚÊÇÕÒÁ˸ö.NETµÄ¿â Finisar.SQLite £¬µ½Õâ¶ùÈ¥ÔØ http://adodotnetsqlite.sourceforge.net/
Òª¼ÇµÄÒ²²»ÊÇʲô´ó²»Á˵Ķ«Î÷£¬Ê¾ÀýÍøÕ¾É϶ ......

sqliteÊý¾Ý¿â»ù±¾²Ù×÷

//²åÈë¼°¸üвÙ×÷
 int nRet = 0;
 sqlite3 * db = NULL;
 CString strFilePath;  //Êý¾Ý¿â´æ´¢Â·¾¶
//·¾¶¸³Öµ£¨Ê¡ÂÔ£©
 //Á¬½ÓÊý¾Ý¿â
 nRet = sqlite3_open16(strFilePath, &db);    //Óм¸¸ö´ò¿ªº¯Êý¿É¹©µ÷Óã¬Ê¹ÓÃWCHARÀàÐÍ·¾¶ÓÃÕâ¸ö
 if(nRet != SQLIT ......

SQLite3µÄC±à³Ì

/*=================================
.*  The Standard include file.
.*
.*===============================*/
#include <stdio.h>
#include <stdlib.h>
/*=================================
.*
.*  The extend include file.
.*
.*===============================*/
#include "sqlit ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ