oracleµÄnvlº¯ÊýµÄÓ÷¨
oracleµÄnvlº¯ÊýµÄÓ÷¨ ͨ¹ý²éѯ»ñµÃij¸ö×ֶεĺϼÆÖµ£¬Èç¹ûÕâ¸öֵλnull½«¸ø³öÒ»¸öÔ¤ÉèµÄĬÈÏÖµ
select nvl(sum(t.dwxhl),1) from tb_jhde t where zydm=-1ÕâÀï¹ØÐĵÄnvlµÄÓ÷¨£¬nvl£¨arg,value£©´ú±íÈç¹ûÇ°ÃæµÄargµÄֵΪnullÄÇô·µ»ØµÄֵΪºóÃæµÄvalue
Èç: NVL(a,b)¾ÍÊÇÅжÏaÊÇ·ñÊÇNULL,Èç¹û²»ÊÇ·µ»ØaµÄÖµ£¬Èç¹ûÊÇ·µ»ØbµÄÖµ ͨ¹ý²éѯ»ñµÃij¸ö×ֶεĺϼÆÖµ£¬Èç¹ûÕâ¸öֵλnull½«¸ø³öÒ»¸öÔ¤ÉèµÄĬÈÏÖµ
select nvl(sum(t.dwxhl),1) from tb_jhde t where zydm=-1ÕâÀï¹ØÐĵÄnvlµÄÓ÷¨£¬nvl£¨arg,value£©´ú±íÈç¹ûÇ°ÃæµÄargµÄֵΪnullÄÇô·µ»ØµÄֵΪºóÃæµÄvalue ÖйúÍø¹ÜÁªÃË ÁíÒ»¸öÓйصÄÓÐÓ÷½·¨
declare
i integer
select nvl(sum(t.dwxhl),1) into i from tb_jhde t where zydm=-1ÕâÑù¾Í¿ÉÒÔ°Ñ»ñµÃµÄºÏ¼ÆÖµ´æ´¢µ½±äÁ¿iÖУ¬Èç¹û²éѯµÄֵΪnull¾Í°ÑËüµÄÖµÉèÖÃΪĬÈϵÄ1 OracleµÃNvlº¯Êý nvl( ) º¯Êý ´ÓÁ½¸ö±í´ïʽ·µ»ØÒ»¸ö·Ç null Öµ¡£
Óï·¨
NVL(eExpression1, eExpression2)
²ÎÊý
eExpression1, eExpression2
Èç ¹û eExpression1 µÄ¼ÆËã½á¹ûΪ null Öµ£¬Ôò NVL( ) ·µ»Ø eExpression2¡£Èç¹û eExpression1 µÄ¼ÆËã½á¹û²»ÊÇ null Öµ£¬Ôò·µ»Ø eExpression1¡£eExpression1 ºÍ eExpression2 ¿ÉÒÔÊÇÈÎÒâÒ»ÖÖÊý¾ÝÀàÐÍ¡£Èç¹û eExpression1 Óë eExpression2 µÄ½á¹û½ÔΪ null Öµ£¬Ôò NVL( ) ·µ»Ø .NULL.¡£
·µ»ØÖµÀàÐÍ
×Ö·ûÐÍ¡¢ÈÕÆÚÐÍ¡¢ÈÕÆÚʱ¼äÐÍ¡¢ÊýÖµÐÍ¡¢»õ±ÒÐÍ¡¢Âß¼ÐÍ»ò null Öµ
˵Ã÷
ÔÚ²»Ö§³Ö null Öµ»ò null ÖµÎ޹ؽôÒªµÄÇé¿öÏ£¬¿ÉÒÔʹÓà NVL( ) À´ÒÆÈ¥¼ÆËã»ò²Ù×÷ÖÐµÄ null Öµ¡£ select nvl(a.name,'¿ÕµÃ') as name from student a join school b on a.ID=b.ID ×¢Ò⣺Á½¸ö²ÎÊýµÃÀàÐÍҪƥÅä ÎÊ£ºÊ²Ã´ÊÇNULL£¿ ´ð£ºÔÚÎÒÃDz»ÖªµÀ¾ßÌåÓÐʲôÊý¾ÝµÄʱºò£¬Ò²¼´Î´Öª£¬¿ÉÒÔÓÃNULL£¬ ÎÒÃdzÆËüΪ¿Õ£¬ORACLEÖУ¬º¬ÓпÕÖµµÄ±íÁ㤶ÈΪÁã¡£
ORACLEÔÊÐíÈκÎÒ»ÖÖÊý¾ÝÀàÐ͵Ä×Ö¶ÎΪ¿Õ£¬³ýÁËÒÔÏÂÁ½ÖÖÇé¿ö£º 1¡¢Ö÷¼ü×ֶΣ¨primary key£©£¬ 2¡¢¶¨ÒåʱÒѾ¼ÓÁËNOT NULLÏÞÖÆÌõ¼þµÄ×ֶΠ˵Ã÷£º 1¡¢µÈ¼ÛÓÚûÓÐÈκÎÖµ¡¢ÊÇδ֪Êý¡£ 2¡¢NULLÓë0¡¢¿Õ×Ö·û´®¡¢¿Õ¸ñ¶¼²»Í¬¡£ 3¡¢¶Ô¿ÕÖµ×ö¼Ó¡¢¼õ¡¢³Ë¡¢³ýµÈÔËËã²Ù×÷£¬½á¹ûÈÔΪ¿Õ¡£ 4¡¢NULLµÄ´¦ÀíʹÓÃNVLº¯Êý¡£ 5¡¢±È½ÏʱʹÓùؼü×ÖÓá°is null¡±ºÍ¡°is not null¡±¡£ 6¡¢¿ÕÖµ²»Äܱ»Ë÷Òý£¬ËùÒÔ²éѯʱÓÐЩ·ûºÏÌõ¼þµÄÊý¾Ý¿ÉÄܲ鲻³öÀ´£¬ count(*)ÖУ¬ÓÃnvl(ÁÐÃû
Ïà¹ØÎĵµ£º
ÔÎÄ´«ËÍÃÅ£ºhttp://www.blogjava.net/improviser/archive/2008/12/07/244911.html
ÔÚǰһƪÎÄÕÂÖмòµ¥½éÉÜÁËJAVA³ÌÐòÈçºÎµ÷ÓÃOracle´æ´¢¹ý³ÌµÄ»ù±¾Óï·¨³ÌÐò½á¹¹£¬ ±¾ÎĽ«½éÉÜJAVA¸úOracleµÄÁíÒ»ÖÖ¹Øϵ£¬¼´Í¨¹ýJAVA±àдOracle´æ´¢¹ý³Ì¡£ ͨ³£Çé¿öÏ£¬ÎÒÃǶ¼ÊÇʹÓÃOracleÊý¾Ý¿âϵͳÖеÄps/sqlÓï¾äÀ´Îªoracle±àд ......
×°Á˸öOracle 10g£¬È´·¢ÏÖÕÒ²»µ½ÆóÒµ¹ÜÀíÆ÷ÁË¡£ÔÀ´10gÓÖÉý¼¶Á˹ÜÀí¹¤¾ß£¬²»ÔÙ²ÉÓÃ8i, 9iµÄÄÇЩJava¹¤¾ßÁË£¬¶øÊÇÓëʱ¾ã½øµØ¸ÄÓÃÁËWeb·½Ê½¡£°´ÕÕÍøÉϵķ½·¨£ºhttp://»úÆ÷µÄIPµØÖ·:5500/em£¬»¹ÊÇûÓÐÁ¬ÉÏ¡£ÄѵÀ¶Ë¿ÚºÅ²»¶ÔÂð£¿
²é¿´Oracle 10g°²×°Ä¿Â¼installϵÄreadmeÎļþ£º
ÏÔʾ£º
Êý¾Ý ......
1.oralceɾ³ýÃüÁî
1.1.ɾ³ýÓû§
drop user username cascade;
1.2.ɾ³ý±í¿Õ¼ä
DROP TABLESPACE dataspace INCLUDING CONTENTS AND DATAFILES;
2.´´½¨±í¿Õ¼ä
2.1.½¨Á¢±í¿Õ¼ä
CREATE TABLESPACE dataspace
DATAFILE '/Ŀ¼/dataspace.dbf' SIZE 500M
UNIFORM SIZE 128k; //Ö¸¶¨Çø³ß´çΪ128k,Èç²»Ö¸¶¨£¬Çø³ß´çĬÈÏÎ ......
×î½ü¿ÕÏÐʱ¼ä½Ï¶à£¬¿ªÊ¼Ñ§Ï°OracleÊý¾Ý¿â֪ʶ¡£ÏÂÎÄÊǶÔOracleÊý¾Ý¿âÏà¹Ø¸ÅÄîµÄһЩ±Ê¼Ç¡£
³õѧOracle£¬Àí½âOracleʵÀý¡¢OracleÊý¾Ý¿âºÍOracle·þÎñÆ÷µÈÃû´ÊÊõÓïÊǺÜÖØÒªµÄ¡£
ÊõÓï½âÊÍ:
OracleʵÀý/OracleÊý¾Ý¿â
Ò»°ãOracleÊý¾Ý¿â(Oracle Database)¿ÉÒÔ·ÖΪÁ½²¿ ......
µ¥±íÊý¾ÝǨÒÆ£ºÖ§³Öclob,blob
exp estarcom/estarcom@ORACLE tables=AA direct=y file=C:/AAA1.dmp
¡¡¡¡ imp estarcom/estarcom@ORACLE tables=AA file=C:/AAA1.dmp fromuser=estarcom touser=estarcom
È«¿âÊý¾ÝǨÒÆ
exp userid=zhongxin/zhongxin@ORACLE own ......