ͨ¹ý·ÖÎöSQLÓï¾äµÄÖ´Ðмƻ®ÓÅ»¯SQL(Áù)
Ö´Ðмƻ®µÄ²½Öè
Ö´Ðмƻ®µÄÿһ²½·µ»ØÒ»×éÐУ¬ËüÃÇ»òÕßΪÏÂÒ»²½ËùʹÓ㬻òÕßÔÚ×îºóÒ»²½Ê±·µ»Ø¸ø·¢³öSQLÓï¾äµÄÓû§»òÓ¦Óá£ÓÉÿһ²½·µ»ØµÄÒ»×éÐнÐ×öÐÐÔ´(row source£©¡£Í¼5-1Ê÷״ͼÏÔʾÁË´ÓÒ»²½µ½ÁíÒ»²½ÐÐÊý¾ÝµÄÁ÷¶¯Çé¿ö¡£Ã¿²½µÄ±àºÅ·´Ó³ÁËÔÚÄã¹Û²ìÖ´Ðмƻ®Ê±Ëùʾ²½ÖèµÄ˳Ðò£¨ÈçºÎ¹Û²ìÖ´Ðмƻ®½«±»¼ò¶ÌµØ˵Ã÷£©¡£Ò»°ãÀ´ËµÕâ²¢²»ÊÇÿһ²½±»Ö´ÐеÄÏȺó˳Ðò¡£Ö´Ðмƻ®µÄÿһ²½»òÕß´ÓÊý¾Ý¿âÖмìË÷ÐУ¬»òÕß½ÓÊÕÀ´×ÔÒ»¸ö»ò¶à¸öÐÐÔ´µÄÐÐÊý¾Ý×÷ΪÊäÈ룺
ÓɺìÉ«×Ö¿òÖ¸³öµÄ²½Öè´ÓÊý¾Ý¿âÖеÄÊý¾ÝÎļþÖÐÎïÀí¼ìË÷Êý¾Ý¡£ÕâÖÖ²½Öè±»³Æ֮Ϊ´æȡ·¾¶£¬ºóÃæ»áÏêϸ½éÉÜÔÚOracle¿ÉÒÔʹÓõĴæȡ·¾¶£º
µÚ£³²½ºÍµÚ£¶²½·Ö±ðµÄ´ÓEMP±íºÍSALGRADE±í¶ÁËùÓеÄÐС£
µÚ£µ²½ÔÚPK_DEPTNOË÷ÒýÖвéÕÒÓɲ½Ö裳·µ»ØµÄÿ¸öDEPTNOÖµ¡£ËüÕÒ³öÓëDEPT±íÖÐÏà¹ØÁªµÄÄÇЩÐеÄROWID¡£
µÚ£´²½´ÓDEPT±íÖмìË÷³öROWIDΪµÚ£µ²½·µ»ØµÄÄÇЩÐС£
ÓɺÚÉ«×Ö¿òÖ¸³öµÄ²½ÖèÔÚÐÐÔ´ÉϲÙ×÷£¬Èç×ö2±íÖ®¼äµÄ¹ØÁª£¬ÅÅÐò£¬»ò¹ýÂ˵ȲÙ×÷£¬ºóÃæÒ²»á¸ø³öÏêϸµÄ½éÉÜ£º
µÚ£²²½ÊµÏÖǶÌ×µÄÑ»·²Ù×÷(Ï൱ÓÚCÓï¾äÖеÄǶÌ×Ñ»·)£¬½ÓÊÕ´ÓµÚ£³²½ºÍµÚ£´²½À´µÄÐÐÔ´£¬°ÑÀ´×ÔµÚ£³²½Ô´µÄÿһÐÐÓëËüµÚ£´²½ÖÐÏàÓ¦µÄÐÐÁ¬½ÓÔÚÒ»Æ𣬷µ»Ø½á¹ûÐе½µÚ£±²½¡£
µÚ£±²½Íê³ÉÒ»¸ö¹ýÂËÆ÷²Ù×÷¡£Ëü½ÓÊÕÀ´×ÔµÚ£²²½ºÍµÚ£¶²½µÄÐÐÔ´£¬Ïû³ýµôµÚ£²²½ÖÐÀ´µÄ£¬ÔÚµÚ£¶²½ÓÐÏàÓ¦ÐеÄÄÇЩÐУ¬²¢½«À´×ÔµÚ£²²½µÄʣϵÄÐзµ»Ø¸ø·¢³öÓï¾äµÄÓû§»òÓ¦Óá£
ʵÏÖÖ´Ðмƻ®²½ÖèµÄ˳Ðò
Ö´Ðмƻ®ÖеIJ½Öè²»ÊÇ°´ÕÕËüÃDZàºÅµÄ˳ÐòÀ´ÊµÏֵģºOracleÊ×ÏÈʵÏÖͼ5-1Ê÷½á¹¹Í¼ÐÎÀï×÷ΪҶ×Ó³öÏÖµÄÄÇЩ²½Öè(ÀýÈç²½Öè3¡¢5¡¢6)¡£ÓÉÿһ²½·µ»ØµÄÐгÆΪËüÏÂÒ»²½ÖèµÄÐÐÔ´¡£È»ºóOracleʵÏÖ¸¸²½Öè¡£
¾ÙÀýÀ´Ëµ£¬ÎªÁËÖ´ÐÐͼ5-1ÖеÄÓï¾ä£¬OracleÒÔÏÂÁÐ˳ÐòʵÏÖÕâЩ²½Ö裺
Ê×ÏÈ£¬OracleʵÏÖ²½Ö裳£¬²¢Ò»ÐÐÒ»Ðеؽ«½á¹ûÐзµ»Ø¸øµÚ£²²½¡£
¶ÔµÚ£³²½·µ»ØµÄÿһÐУ¬OracleʵÏÖÕâЩ²½Ö裺
-- OracleʵÏÖ²½Ö裵£¬²¢½«½á¹ûROWID·µ»Ø¸øµÚ£´²½¡£
-- OracleʵÏÖ²½Ö裴£¬²¢½«½á¹ûÐзµ»Ø¸øµÚ£²²½¡£
-- OracleʵÏÖ²½Ö裲£¬½«½ÓÊÜÀ´×ÔµÚ£³²½µÄÒ»ÐкÍÀ´×ÔµÚ£´²½µÄÒ»ÐУ¬²¢·µ»Ø
¸øµÚ£±²½Ò»ÐС£
-- OracleʵÏÖ²½Ö裶£¬Èç¹ûÓнá¹ûÐеĻ°£¬½«Ëü·µ»Ø¸øµÚ£±²½¡£
-- OracleʵÏÖ²½Ö裱£¬Èç¹û´Ó²½Ö裶·µ»ØÐУ¬Oracle½«À´×ÔµÚ£²²½µÄÐзµ»Ø¸ø
·¢³öSQLÓï¾äµÄÓû§¡£
×¢ÒâOracle¶ÔÓɵڣ³²½·µ»ØµÄÿһÐÐʵÏÖ²½Ö裵£¬£´£¬£²£¬£¶Ò»´Î¡£Ðí¶à¸¸²½ÖèÔÚËüÃÇÄÜÖ´ÐÐ֮ǰֻÐèÒªÀ´×ÔËüÃÇ×Ó²½ÖèµÄµ¥Ò»
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
SQL¿Í»§¶ËÊÇÿ¸ö¿ª·¢ÈËÔ±ËùÐèµÄ±Ø²»¿ÉÉٵŤ¾ß¡£ËûÃÇ°ïÖú¿ª·¢ÈËÔ±ÇáËɵØÔÚÈκÎÊý¾Ý¿âÖ´ÐÐSQL²éѯ¡£ËüÃǶÔÓÚ½â¾öÈκÎÊý¾Ý¿âÏà¹ØµÄÎÊÌâÒ²ÊǷdz£ÖØÒªµÄ¡£
1. SQuirreL SQL Client
SQuirreL SQL ClientÊÇÄ¿Ç°×îÁ÷ÐеĿªÔ´SQL¿Í»§¶Ë¡£ ......
×öÊý¾Ý¿â¿ª·¢»ò¹ÜÀíµÄÈ˾³£Òª´´½¨´óÁ¿µÄ²âÊÔÊý¾Ý£¬¶¯²»¶¯¾ÍÐèÒªÉÏÍòÌõ£¬Èç¹ûÒ»ÌõÒ»ÌõµÄ¼È룬ÄÇ»áÀË·Ñ´óÁ¿µÄʱ¼ä£¬±¾ÎĽéÉÜÁËOracleÖÐÈçºÎͨ¹ýÒ»ÌõSQL¿ìËÙÉú³É´óÁ¿µÄ²âÊÔÊý¾ÝµÄ·½·¨¡£
²úÉú²âÊÔÊý¾ÝµÄSQLÈçÏ£º
SQL> select rownum as id,
2 &nb ......
ÔÚWin7Ï°²×°SQL2005¿ª·¢°æ£¬°²×°SQL Native ClientʱÌáʾ°²×°Öжϣ¬Ã»ÓÐÔÚÒ⣬ȻºóÔÚ°²×°SQL ServerʱÓÖÌáʾ“[Microsoft][SQL Native Client]¿Í»§¶Ë²»Ö§³Ö¼ÓÃÜ.SQL Server °²×°³ÌÐòÎÞ·¨Á¬½Óµ½Êý¾Ý¿â·þÎñ½øÐзþÎñÆ÷ÅäÖÃ.”жÔØSQL Native ClientÖØа²×°£¬»¹ÊÇÖжϣ¬ÐÞ¸´£¬Ò²Öжϣ¬ÔÙжÔØ£¬ÇåÀí×¢²á±í£¬ÖØ× ......