sqlÖеÄDBO
DBOÊÇÿ¸öÊý¾Ý¿âµÄĬÈÏÓû§£¬¾ßÓÐËùÓÐÕßȨÏÞ£¬¼´DbOwner
ͨ¹ýÓÃDBO×÷ΪËùÓÐÕßÀ´¶¨Òå¶ÔÏó£¬Äܹ»Ê¹Êý¾Ý¿âÖеÄÈκÎÓû§ÒýÓöø²»±ØÌṩËùÓÐÕßÃû³Æ¡£
±ÈÈ磺ÄãÒÔUser1µÇ¼½øÈ¥²¢½¨±íTable£¬¶øÎ´Ö¸¶¨DBO£¬
µ±Óû§User2µÇ½øÈ¥Ïë·ÃÎÊTableʱ¾ÍµÃÖªµÀÕâ¸öTableÊÇÄãUser1½¨Á¢µÄ£¬ÒªÐ´ÉÏUser1.Table£¬Èç¹ûËû²»ÖªµÀÊÇÄ㽨µÄ£¬Ôò·ÃÎÊ»áÓÐÎÊÌâ¡£
Èç¹ûÄ㽨±íʱ°ÑËùÓÐÕßÖ¸¸øÁËDbo£¬Ôò±ðµÄÓû§½øÀ´Ê±Ð´ÉÏDbo.Table¾ÍÐÐÁË£¬²»±ØÖªµÀUser1¡£
²»¹â±íÊÇÈç´Ë£¬ÊÓͼµÈµÈÊý¾Ý¿â¶ÔÏó½¨Á¢Ê±Ò²ÒªÈç´Ë²ÅËãÊǺá£
½¨±í¡¢´æ´¢¹ý³Ì¡¢ÊÓͼµÈÊý¾Ý¿â¶ÔÏóʱ£¬Æä¶ÔÓ¦µÄËùÓÐÕßÊÇ´´½¨ËüµÄÓû§¡£Ôò³ýÁ˸ÃÓû§ÆäËûµÇ¼Óû§ÒªÒýÓÃÕâЩ¶«¶«Ê±£¬¶¼Òª¼ÓÉÏǰ׺£¬ºÜÊÇÂé·³¡£¶øÇÒ£¬³ÌÐòÒò´ËÒ׳ö´í£¬Äã²éÀ´²éÈ¥ÎÊÌâÈ·³öÔÚÕ⣬ÀË·ÑÄãʱ¼ä¡£
Ïà¹ØÎĵµ£º
01¡¢SQLÓëORACLEµÄÄÚ´æ·ÖÅä
ORACLEµÄÄÚ´æ·ÖÅä´ó²¿·ÖÊÇÓÉINIT.ORAÀ´¾ö¶¨µÄ£¬Ò»¸öÊý¾Ý¿âʵÀý¿ÉÒÔÓÐNÖÖ·ÖÅä·½°¸£¬²»Í¬µÄÓ¦Óã¨OLTP¡¢OLAP£©ËüµÄÅäÖÃÊÇÓвàÖØµÄ¡£ SQL¸ÅÀ¨ÆðÀ´Ëµ£¬Ö»ÓÐÁ½ÖÖÄÚ´æ·ÖÅ䷽ʽ£º¶¯Ì¬ÄÚ´æ·ÖÅäÓ뾲̬ÄÚ´æ·ÖÅ䣬¶¯Ì¬ÄÚ´æ·ÖÅä³äÐíSQL×Ô¼ºµ÷ÕûÐèÒªµÄÄڴ棬¾²Ì¬ÄÚ´æ·ÖÅäÏÞÖÆÁËSQL¶ÔÄÚ´æµÄʹ Óá£
002¡¢SQ ......
1.OracleÔõÑù´æ´¢Îı¾
CHARºÍVARCHAR2µÄÇø±ð
•CHAR¶¨³¤×Ö·û´®£¬VARCHAR2±ä³¤×Ö·û´®¡£
•CHAR(n) ¶¨³¤×Ö·û´®£¬n×Ö½Ú£¬nµÄȡֵ·¶Î§£º1~2000×Ö½Ú¡£
•VARCHAR2(n) ¿É±ä³¤µÄ×Ö·û´®£¬¶¨ÒåʱӦָÃ÷×î´ó³¤¶È£¬È¡Öµ·¶Î§£º1~ 4000×Ö½Ú¡£
2. OracleÔõÑù´æ´¢ÊýÖµ
ÊýÖµÀàÐÍ˵Ã÷£º NUMBER£¨m , n£©
Êý×Ö ......
1. ¶¨ÒåÓα궨Òå
ÓαêÓï¾äµÄºËÐÄÊǶ¨ÒåÁËÒ»¸öÓαê±êʶÃû£¬²¢°ÑÓαê±êʶÃûºÍÒ»¸ö²éѯÓï¾ä¹ØÁªÆðÀ´¡£DECLAREÓï¾äÓÃÓÚÉùÃ÷Óα꣬Ëüͨ¹ýSELECT²éѯ¶¨ÒåÓÎ±ê´æ´¢µÄÊý¾Ý¼¯ºÏ¡£Óï¾ä¸ñʽΪ£º
DECLARE ÓαêÃû³Æ [INSENSITIVE] [SCROLL]
CURSOR FOR selectÓï¾ä
[FOR{READ ONLY|UPDATE[OF ÁÐÃû×Ö±í]}]
²ÎÊý˵Ã÷£º
INSENSITIVEÑ¡Ï ......
oracle ͬÒå´Ê synonym ΪÊý¾Ý¿â¶ÔÏó½¨Á¢Í¬Òå´Êºó,µ±dba¶ÔÊý¾Ý¿â¶ÔÏó(table,view,ÐòÁÐ)×öÁËÒ»¸ö¼òµ¥¸Ä¶¯Ö®ºó,ÈçÃû×Ö»òÕ߽ṹ¸Ä±ä,Ôò²»ÐèÒªÖØÐ¸ü¸Ä²¢±àÒëÓ¦ÓÃ.ÔÚÊý¾Ý¿â×ÖµäÖÐÓж¨Òå,²»ÐèÒª½øÐÐÈκδ洢.
oracle±ðÃûalias,With as¡¡Éú³ÉÒ»¸öÁÙʱ±í£¬¶ÔÓÚ¸´ÔÓµÄÊý¾Ý²éѯ£¬¿ÉÒÔ¼õÉÙ×ÊÔ´ÏûºÄ¡¢Ìá¸ßÐÔÄÜ¡£9iÒýÈë¡£
with alias ......