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

ÔÚ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 µÄÅäÖÃÎļþÖÐÌí¼ÓÖ¸Ïò¾ßÌåÊý¾Ý¿âµÄ·ÃÎÊÐ


Ïà¹ØÎĵµ£º

SQLÁ¬½Ó²éѯ(»ã×Ü)

Ò»¡¢½»²æÁ¬½Ó£¨CROSS JOIN£©
½»²æÁ¬½Ó£¨CROSS JOIN£©£ºÓÐÁ½ÖÖ£¬ÏÔʽµÄºÍÒþʽµÄ£¬²»´øON×Ӿ䣬·µ»ØµÄÊÇÁ½±íµÄ³Ë»ý£¬Ò²½ÐµÑ¿¨¶û»ý¡£
ÀýÈ磺ÏÂÃæµÄÓï¾ä1ºÍÓï¾ä2µÄ½á¹ûÊÇÏàͬµÄ¡£
Óï¾ä1£ºÒþʽµÄ½»²æÁ¬½Ó£¬Ã»ÓÐCROSS JOIN¡£
SELECT O.ID, O.ORDER_NUMBER, C.ID, C.NAME
from ORDERS O , CUSTOMERS C
WHERE O.ID=1;
Óï¾ä2£ ......

MS SQL ServerÁ¬½ÓOracle

1.  °²×°oracle 10G¿Í»§¶Ë
Òª·ÃÎÊoracleÊý¾Ý¿â±ØÐë°²×°oracle¿Í»§¶Ë¡£°²×°oracle¿Í»§¶ËÓÐÁ½ÖÖ·½Ê½£¬¼´ÍêÕû°²×°ºÍÁ¢¼´°²×°£¬ÕâÁ½ÖÖ·½Ê½¶¼¿ÉÒÔ¡£°²×°ÍêºóÅäÖÃÒªÁ´½ÓÊý¾Ý¿â·þÎñÆ÷¡£
$ORACLE_HOME\network\admin\tnsname.ora
ÔÚ´ËÅäÖÃÎļþÀïÌí¼ÓÈçÏÂÄÚÈÝ£º
sunora =
  (DESCRIPTION =
    ......

ͨ¹ýSQL´úÂëÊÕËõÊý¾Ý¿â

 
/*------------------------------------------------------------------
--  Author : htl258(Tony)
--  Date   : 2010-04-16 14:30:23
--  Version: Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86)
    Jul  9 2008 14:43:34
  &nb ......

ÔÚsql serverÖÐÊäÈë'NULL'×Ö·û´®µÄÓÐȤ·¢ÏÖ£¡

Èçͼ1¡¢2£¬id=1µÄÊý¾ÝÊÇNULL£¬ÆäËûµÄΪ·ÇNULLµÄÊý¾Ý¡£
Ò»°ãÇé¿öÏ£¬»áÓÃÁ½ÖÖ·½·¨£¡
·½·¨1.t-sql£ºinsert into E values(1,'NULL')£¬²åÈëºó£¬ÔÚ´ò¿ª±íµÄÇé¿öÏ¿´µ½µÄ
ÊÇ'NULL'£¨ÎÒÏëÊÇΪÁËÇø·ÖNULL£¬²Å¼ÓµÄÒýºÅ£©£¬µ«ÊDzéѯµÄʱºò²»Ó°Ï죬ÏÔʾµÄÊÇNULL£¬
Èçͼ1¡¢2£¬idΪ6µÄÊý¾Ý¡£
Èç¹ûÒª²åÈë´øµ¥ÒýºÅµÄ'NULL'£¬insert i ......

ʹÓÃSQL*PLUS¹¹½¨ÍêÃÀexcel»òhtmlÊä³ö

ת×Ô£ºhttp://hong9270503.blog.163.com/blog/static/127292320091611319516/
ͨ¹ýSQL*PLUSÎÒÃÇ¿ÉÒÔ¹¹½¨ÓѺõÄÊä³ö£¬Âú×ã¶àÑù»¯Óû§ÐèÇó¡£
¡¡¡¡
±¾Àýͨ¹ý¼òµ¥Ê¾Àý£¬½éÉÜͨ¹ýsql*plusÊä³öxls£¬htmlÁ½ÖÖ¸ñʽÎļþ.
¡¡¡¡ Ê×ÏÈ´´½¨Á½¸ö½Å±¾:
¡¡¡¡
1.main.sql
¡¡¡¡ ÓÃÒÔÉèÖû·¾³£¬µ÷ÓþßÌ幦Äܽű¾
¡¡¡¡ 2.¹¦Äܽű¾-ge ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ