ÔÚlinuxÉÏÅäÖÃunixODBCºÍFreeTDS·ÃÎÊMS SQL Server.
Ò», °²×° unixODBC
ÏÂÔØ°²×°°ü. ÔÚ RedHat °²×°¹âÅÌÉϾÍÓÐ
unixODBC-2.2.11-1.RHEL4.1.i386.rpm
unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm
unixODBC-kde-2.2.11-1.RHEL4.1.i386.rpm
°²×°
rpm -Uvh unixODBC-2.2.11-1.RHEL4.1.i386.rpm
rpm -Uvh unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm
Èç¹û°²×°ÖÐÌáʾÓÐ¶ÔÆäËü°²×°°üµÄÒÀÀµ,Ôò°´ÕÕÌáʾÏȰ²×°
ÄÄЩ°ü.
»òÕß´ÓÔ´Âë°²×° unixODBC
ÏÂÔØÔ´Â뼯
unixODBC-2.2.11.tar.gz
# tar xzf unixODBC-2.2.11.tar.gz
# cd unixODBC-2.2.11
# ./configure
# make
# make install
./configure µÄʱºòÒ²ÓпÉÄÜÌáʾÕÒ²»µ½Ä³Ð©ÒÀÀµ¿â.
ÏÂÔØÕâЩÒÀÀµ¿âµÄÔ´Âë,±àÒë,°²×°.
rpm °²×°ºÍÔ´Âë±àÒë°²×°µÄ²î±ðÔÚÓÚÅäÖÃÎļþ odbc.ini, odbcinst.ini
µÄλÖò»Í¬. ǰÕßΪ /etc , ºóÕßΪ /usr/local/etc
¶þ, °²×° FreeTDS
unixODBC ÌṩÁËLinux ¶ÔODBC µÄÖ§³Ö,µ«ËüÖ»ÊÇÒ»¸ö ODBCµÄ¹ÜÀíÆ÷, ÒªÁ¬½Ó
ʵ¼ÊµÄÊý¾Ý¿â»¹µÃÌṩÕâÖÖÊý¾Ý¿âµÄ ODBC Çý¶¯.
FreeTDS¾ÍÊÇLinux Ï ÓÃÓÚÁ¬½ÓMS SQL Server ºÍ Sybase µÄÃâ·ÑODBC Çý¶¯
×¢Òâ, ±ØÐëÏÈ×° unixODBC, ÔÙ×° freetds
freetds-0.64 ÊÇĿǰµÄ×îÐÂÎȶ¨°æ.
ÏÂÔØÔ´Âë°ü freetds-stable.tgz
# tar xzf freetds-stable.tgz
# ./configure --with-unixodbc=/usr/local --with-tdsver=8.0
# make
# su
# make install
½«°²×°µ½ /usr/local ÏÂ
Èç¹û unixODBCÊÇÔ´Âë°²×°, Ôò
--with-unixodbc=/usr/local
Èç¹û unixODBCÊÇrpm°²×°, Ôò
²»ÐèÒª¸ÃÑ¡Ïî
Èý, ÅäÖà unixODBC ºÍ FreeTDS
3.1 ÏòunixODBC µÇ¼Ç FreeTDS Çý¶¯
ÐÞ¸Ä /etc/odbcinst.ini (»òÕß/usr/local/etc/odbcinst.ini)
ÔÚÎļþÖÐÌí¼Ó
=========================== /etc/odbcinst.ini ======================
# Driver from FreeTDS package
# setup from FreeTDS package
[FREETDS]
Description = ODBC of FreeTDS for MS SQL 2000
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/local/lib/libtds.so
FileUsage = 1
===================================================================
3.2 ÔÚ FreeTDS µÄÅäÖÃÎļþÖÐÌí¼ÓÖ¸Ïò¾ßÌåÊý¾Ý¿âµÄ·ÃÎÊÐÅÏ
Ïà¹ØÎĵµ£º
2009 Äê 4 ÔÂ 23 ÈÕ
±¾ÎÄÖÐÎÒÃÇÕë¶Ô Linux É϶àÏ̱߳à³ÌµÄÖ÷ÒªÌØÐÔ×ܽá³ö 5 Ìõ¾Ñ飬ÓÃÒÔ¸ÄÉÆ Linux ¶àÏ̱߳à³ÌµÄϰ¹ßºÍ±ÜÃâÆäÖеĿª·¢ÏÝÚå¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃÇ´©²åһЩ Windows µÄ±à³ÌÓÃÀýÓÃÒÔ¶Ô±È Linux ÌØÐÔ£¬ÒÔ¼ÓÉî¶ÁÕßÓ¡Ïó¡£
±³¾°
Linux ƽ̨ÉϵĶàÏ̳߳ÌÐò¿ª·¢Ïà¶ÔÓ¦ÆäËûƽ̨£¨±ÈÈç Windows£©µÄ¶àÏß³Ì API ÓÐһЩϸ΢ ......
Á¬½Ó²éѯ
¡¡¡¡Í¨¹ýÁ¬½ÓÔËËã·û¿ÉÒÔʵÏÖ¶à¸ö±í²éѯ¡£Á¬½ÓÊǹØÏµÊý¾Ý¿âÄ£Ð͵ÄÖ÷ÒªÌØµã£¬Ò²ÊÇËüÇø±ðÓÚÆäËüÀàÐÍÊý¾Ý¿â¹ÜÀíϵͳµÄÒ»¸ö±êÖ¾¡£
¡¡¡¡ÔÚ¹ØÏµÊý¾Ý¿â¹ÜÀíϵͳÖУ¬±í½¨Á¢Ê±¸÷Êý¾ÝÖ®¼äµÄ¹ØÏµ²»±ØÈ·¶¨£¬³£°ÑÒ»¸öʵÌåµÄËùÓÐÐÅÏ¢´æ·ÅÔÚÒ»¸ö±íÖС£µ±¼ìË÷Êý¾Ýʱ£¬Í¨¹ýÁ¬½Ó²Ù×÷²éѯ³ö´æ·ÅÔÚ¶à¸ö±íÖеIJ»Í¬ÊµÌåµÄ ......
Áª½ÓÌõ¼þ¿ÉÔÚ from »ò WHERE ×Ó¾äÖÐÖ¸¶¨£¬½¨ÒéÔÚ from ×Ó¾äÖÐÖ¸¶¨Áª½ÓÌõ¼þ¡£WHERE ºÍ HAVING ×Ó¾äÒ²¿ÉÒÔ°üº¬ËÑË÷Ìõ¼þ£¬ÒÔ½øÒ»²½É¸Ñ¡Áª½ÓÌõ¼þËùÑ¡µÄÐС£
Áª½Ó¿É·ÖΪÒÔϼ¸Àࣺ
1. ......
¼¸ÖÜÒÔǰ£¬ÎÞÒâÖп´ÁËÎÒ¿ª·¢Linux·þÎñ³ÌÐòµÄ¹¤×÷»·¾³´îÅäÕâÆªÎÄÕ£¬È̲»×¡ÅÄÁËש£¬½á¹û×÷ÕßÔڻظ´Öм¤ÎÒ£¬ÒªÎÒд¸ö¿´¿´¡£Æäʵ¿´²»¹ßºÜ¶àÈËÎ§ÈÆM$µÄϰ¹ß£¬ÔçÒÑÓÐдµãʲôµÄÏë·¨£¬¿ÉÊÇûʲôʱ¼ä£¬Ò²µ£ÐIJ»Í¬µÄÏë·¨ºÍ×Ô¼ºÍ˲½Á˺ܶàµÄÖÐÎÄ»áÃÔ»óÓÐLinuxѧϰÈÈÇéµÄͬÐУ¬¸ü²»ÓÃ˵û׼»¹»áÏÅÅܱðÈË¡£ÎªÁ˱íʾÎÒÊÇ´ÓÀ´²»³Ô¼¤½«·¨ ......