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

Oracle DECODE

Óï·¨£º
DECODE(expr, search, result [, search, result ]... [, default ] )
Ó¦Óãº
DECODEº¯Êý½«Ã¿Ò»¸öexprºÍsearchµÄÖµ×ö±È½Ï¡£Èç¹ûexprµÄÖµÓësearchµÄÖµÏàµÈ£¬OracleÊý¾Ý¿â¾Í»á·µ»ØÏàÓ¦µÄresult¡£Èç¹ûÕÒ²»µ½Æ¥ÅäµÄÖµ£¬Oracle·µ»Ødefault¡£Èç¹ûûÓÐdefault£¬Oracle·µ»ØnullÖµ¡£²ÎÊý¿ÉÒÔÊÇÈÎÒâÊýÖµÀàÐÍ£¨NUMBER£¬BINARY_FLOAT, or BINARY_DOUBLE£©ºÍ×Ö·ûÐÍ¡£   1¡¢Èç¹ûexprºÍsearchÊÇ×Ö·ûÐÍ£¬Oracleͨ¹ý·ÇÌî³äµÄ±È½ÏÓïÒåÀ´±È½ÏËüÃÇ¡£expr£¬searchºÍresult¿ÉÒÔÊÇCHAR, VARCHAR2, NCHAR, or NVARCHAR2ÖÐÈÎÒâÀàÐ͵ÄÊý¾ÝÀàÐÍ¡£×Ö·û´®·µ»ØµÄÊÇVARCHAR2ÐÍÊý¾ÝÀàÐÍ£¬ËüºÍµÚÒ»¸öresult²ÎÊý´¦ÓÚͬһ¸ö×Ö·û¼¯¡£   2¡¢Èç¹ûµÚÒ»¸ösearch-result¶ÔÊÇÊýÖµÐ͵ģ¬Oracle»á±È¶ÔËùÓеÄsearch-result±í´ïʽÒÔ¼°exprÀ´¾ö¶¨¾ßÓÐ×î¸ßÓÅÏȼ¶µÄ²ÎÊýÊýÖµ£¬²¢Òþʽת»»ÆäÓà²ÎÊýµÄÊý¾ÝÀàÐÍÒÔ¼°·µ»ØÖµµÄÊý¾ÝÀàÐÍ¡£search¡¢resultºÍdefaultµÄÖµ¿ÉÒÔÓɱí´ïʽÔËËãµÃÀ´¡£OracleÊý¾Ý¿âʹÓõÄÊǶÌ·ÆÀ¼Û¡£Ò²¾ÍÊÇ˵£¬Êý¾Ý¿âÖ»ÔÚ½«Ã¿¸ösearchÖµºÍexprÖµ¶Ô±È֮ǰ²ÅÆÀ¼ÛsearchµÄÖµ£¬¶ø²»ÊÇÔÚÓëexpr¶Ô±È֮ǰÆÀ¼ÛËùÓеÄsearchÖµ¡£OracleÔڱȶÔ֮ǰ×Ô¶¯½«exprºÍÿ¸ösearchµÄֵת»»³ÉµÚÒ»¸ösearchÖµµÄÊý¾ÝÀàÐÍ£¬²¢×Ô¶¯½«·µ»Øֵת»»³ÉÓëµÚÒ»¸öresultÏàͬµÄÊý¾ÝÀàÐÍ¡£Èç¹ûµÚÒ»¸öresultÓÐCHARÊý¾ÝÀàÐÍ»òÕßΪNULL£¬Oracle»á½«·µ»Øֵת»»³ÉVARCHAR2ÀàÐÍ¡£ÔÚDECODEº¯ÊýÀOracle½«Á½¸önullÖµÈÏΪÊÇÏàµÈµÄ¡£Èç¹ûexprºÍµÚÒ»¸ösearchͬʱΪ¿Õ£¬ÄÇOracle»á·µ»ØËùÓÐËùÓеÄresult¡£ DECODEËùÄÜÈÝÄɵÄ×î´ó²ÎÊýÊýÄ¿ÊÇ255¸ö£¬ÕâÆäÖаüÀ¨expr£¬search£¬resultÒÔ¼°default¡£Àý×Ó£ºÀý×Ó½âÂëwarehouse_idµÄÖµ£¬Èç¹ûwarehouse_idΪ1£¬·µ»ØSouthlake£¬Îª2·µ»ØSan FranciscoµÈµÈ¡£Èç¹ûwarehouse_id²»ÊÇ1,2,3,4ÖеÄÈÎÒâÒ»¸ö£¬º¯Êý·µ»ØNon domestic¡£SELECT product_id,
       DECODE (warehouse_id, 1, 'Southlake',
                             2, 'San Francisco',
                             3, 'New Jersey',
    &n


Ïà¹ØÎĵµ£º

ORACLE binĿ¼Ï¸÷ÎļþµÄÒâÒ弰ʹÓ÷½·¨

ORACLE binĿ¼Ï¸÷ÎļþµÄÒâÒ弰ʹÓ÷½·¨
$ORACLE_HOME/binϵÄutilities½âÊÍ
Binary               First Available         Description
---------         ......

oracle²»Í¬schemaÖ®¼ä½¨Íâ¼ü

ÐèҪȨÏÞ:
  grant references on test_sys to user_1;
 or
  grant all on test_sys to user_1;
²âÊÔ£º
sysÓû§ÏÂ:
SQL> create user user_1 identified by user_1;
Óû§ÒÑ´´½¨¡£
SQL> grant dba to user_1;
ÊÚȨ³É¹¦¡£
SQL> create table test_sys(pk_col varchar2(5))
  2&nbs ......

OracleÏÞÖÆIP·ÃÎÊÉèÖÃ

Ò»¡¢$vi $ORACLE_HOME/network/admin/sqlnet.ora
Èç¹û¸Ãsqlnet.oraÎļþ²»´æÔÚ£¬¿ÉÒÔ²ÉÓÃÈçÏ·½Ê½Éú³É
1£©¿ÉÒÔ¿½±´$ORACLE_HOME/network/admin/samples/sqlnet.oraµ½$ORACLE_HOME/network/admin/Ŀ¼ÏÂʹÓÃ
2£©Ê¹ÓÃnetca¹¤¾ß½øÐÐÅäÖã¬NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
 
¶þ¡¢ÉèÖûòÐ޸IJÎÊý£¨Èç¹û²ÎÊ ......

oracleÐÔÄÜÌá¸ß ÅúÁ¿°ó¶¨

author:skatetime:2010-05-04
ÔÚÎÒÃǵÄϵͳÀ´ó¼ÒÔÚдpl/sqlʱ£¬´¦Àí¶àÌõ¼Ç¼ʱ£¬¼¸ºõ¶¼ÊÇͨ¹ýÓαêÀ´Íê³ÉµÄ£¬ÕâÑùÊǷdz£Ó°ÏìÐÔÄܵġ£ÎÒÃÇ¿ÉÒÔÓÃÅúÁ¿°ó¶¨¿ÉÒÔ´ó´óµÄ¸ÄÉÆ¡£
 
ÅúÁ¿°ó¶¨ÊÇoracle9iÔö¼ÓµÄÌØÐÔ£¬ÊÇÖ¸Ö´Ðе¥´Îsql²Ù×÷ÄÜ´«µÝËùÓм¯ºÏÔªËصÄÊý¾Ý¡£Í¨¹ý°ó¶¨°ó¶¨±äÁ¿¿ÉÒÔ¼«´óµÄÌá¸ßÊý¾Ý´¦ÀíËٶȣ¬Ìá¸ßÓ¦ÓÃ³Ì ......

OracleÁÙʱ±í

Temporary TablesÁÙʱ±í
1¼ò½é
   ORACLEÊý¾Ý¿â³ýÁË¿ÉÒÔ±£´æÓÀ¾Ã±íÍ⣬»¹¿ÉÒÔ½¨Á¢ÁÙʱ±ítemporary tables¡£ÕâЩÁÙʱ±íÓÃÀ´±£´æÒ»¸ö»á»°SESSIONµÄÊý¾Ý£¬
   »òÕß±£´æÔÚÒ»¸öÊÂÎñÖÐÐèÒªµÄÊý¾Ý¡£µ±»á»°Í˳ö»òÕßÓû§Ìá½»commitºÍ»Ø¹örollbackÊÂÎñµÄʱºò£¬ÁÙʱ±íµÄÊý¾Ý×Ô¶¯Çå¿Õ£¬
   µ«ÊÇÁÙʱ± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ