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

Oracle²åÈëÊý¾Ýʱ»ñÈ¡×ÔÔöID

×ÔÔö×ֶΣº
±íatable(id,a) idÐèÒª×ÔÔö Ê×ÏȽ¨Á¢Ò»¸öÐòÁУº
create sequence seq_atable minvalue 1 maxvalue 999999999999999999 start with 1 increment by 1 nocache
ÓжþÖÖ·½Ê½Ê¹ÓÃ×ÔÔö×ֶΣº
ʹÓÃÐòÁÐ+´¥·¢Æ÷ʵÏÖ×ÔÔö£¬²åÈëÓï¾ä²»ÐèÒª¹Ü×ÔÔö×Ö¶Î
È磺create or replace trigger trg_atable before insert on atable for each row begin select seq_atable.nextval into :new.id from dual; end;
²åÈëÊý¾Ý£ºinsert into atable(a) values('test');
×¢£ºÎÒ´´½¨ÁËsequence ºÍtrigger £º£¬Ö®ºóÔÚprocedureÖвåÈëÊý¾Ý£¬²åÈëµÄʱºòûÓйÜID×ֶΣ¬ÔÚÓ¦ÓÃÖУ¬Ê¹ÓÃÁËhibernate£¬ËäÈ»hibernateÔÚÔö¼Ó¼Ç¼µÄʱºòÒ²»á´¦ÀíID£¬µ«ÊÇÌí¼Ó¼Ç¼֮ºó£¬²éѯ¼Ç¼·¢ÏÖ£¬ID»¹ÊǸù¾ÝÐòÁкʹ¥·¢Æ÷µÄ¹æÔòÉèÖõÄ
½öʹÓÃÐòÁУ¬ÐèÒªÔÚ²åÈëÊý¾Ýʱ£¬×ÔÔö×ֶβåÈëÐòÁÐÏÂÒ»¸öÖµ
È磺insert into atable(id,a) values(seq_atable.nextval,'test');
Èý¡¢·µ»Ø¸Õ²åÈë¼Ç¼µÄ×ÔÔö×Ö¶ÎÖµ
ÈçÉÏÃæµÄÀý×Ó£¬ÎÒÃDzåÈëÒ»Ìõ¼Ç¼ºó£¬ÎÒÏëÂíÉÏ·µ»Ø¸Õ²åÈëµÄ¼Ç¼µÄIDºÅ£¬ÎÒ¸ÃÔõô´¦ÀíÄØ£¿
Ê×ÏÈÒª½â¾ö×ÔÔö×ֶεÄÎÊÌ⣬ÉÏÃæµÄ¶þÖÖ·½·¨ÄÄÖÖ¸üÊʺÏÕâÖÖÓ÷¨ÄØ£¿ ½¨ÒéʹÓõڶþÖÖ×ÔÔöÐòÁÐ,·ñÔò´¦ÀíÆðÕâ¸öÎÊÌâÀ´±È½ÏÂé·³¡£
ʹÓÃ×ÔÔö×ֶεĵڶþÖÖ·½·¨£¬ÔÚ²åÈëÒ»Ìõ¼Ç¼ºóÂíÉÏÖ´ÐÐÒ»ÏÂÏÂÃæµÄÓï¾ä¼´·µ»Øµ±Ç°²åÈëÊý¾ÝµÄID¡£
$query="select seq_atable.currval from dual";
seq_atable.currval µÄÖµÖ»ÓÐÔÚͬһ´Î»á»°ÖУ¬·¢Éúseq_atable.nextvalºóÓÐЧ£º£© ËùÒÔ²»»á´æÔÚÈ¡´íÖµµÄÎÊÌâ¡£


Ïà¹ØÎĵµ£º

Oracle Êý¾Ý¿âµÄ°²×°

 
   ×°ÁËÒ»Ò¹µÄÈí¼þ£¬ÏÈÊÇMySQL£¬myEclipse,Oracle ,²»¶ÏµÄ³ö´í£¬OracleServise²»ÄÜÆô¶¯£¬ºÜÊÇ·³ÈË£¬Ð¶ÔØÁËOracelÁ½´Î£¬ÓÖÖØ×°£¬´íÎóµÃµ½Ò»Ð©½â¾ö£¬×¢²á±í³öÏÖÁ˺öàµÄÎÊÌ⣬ÒÔÇ°ÔÚжÔØÈí¼þµÄʱºò£¬¶¼Ã»ÓÐÓÃרÓõŤ¾ß£¬×¢²á±íÒ»ÍÅÂÒ£¬ÕæÊÇÏ൱µÄºó»Ú£¬ÏÖÔÚ¿´À´ÒªÏë¸Ä¹ýÀ´È·ÊµÊǺÜÄѵÄÀ²£¡ÒÔºóÕâ·½ÃæÒª¶à¼ ......

Oracleµ¼Èëµ¼³öÊý¾Ý¿â

µ¼³öÊý¾Ý¿â£ºexp Óû§Ãû/ÃÜÂë@Êý¾Ý¿âÃû file=ÅÌ·û£º/Îļþ¼Ð/ÎļþÃû.bmp owner=Óû§ »ò exp Óû§Ãû/ÃÜÂë@Êý¾Ý¿âÃû file=ÅÌ·û£º/Îļþ¼Ð/ÎļþÃû.bmp full=y
µ¼ÈëÊý¾Ý¿â£ºimp Óû§Ãû/ÃÜÂë@Êý¾Ý¿âÃû file=µ¼³öµÄÎļþ full=y ......

oracle apache phpÂÒÂëÎÊÌâ

°ì·¨Ò»
select * from V$NLS_PARAMETERS
  $conn = oci_connect('scott', 'donkey', 'demo', 'zhs16gbk');
 while ($dat = oci_fetch_row($cur)) {  
    print_r(iconv('gb2312', 'utf-8', $dat[0]));  //$nickname = mb_convert_encoding($dat[0], 'utf-8', 'gbk');&n ......

ORACLEÌåϵ½á¹¹ ORACLE½ø³Ì¼ò½é

ÔÚORACLEʵÀýÆô¶¯Ê±³ýÁË·ÖÅäÒ»¿éºÜ´óÇøÓòµÄÄÚ´æÍ⣬»¹»áÆô¶¯Ò»ÏµÁеĽø³Ì¡£OracleÖеĽø³ÌÓÐÄÄЩÌص㣿
ORACLE½ø³Ì¿ÉÒÔ·ÖΪÓû§½ø³Ì¡¢·þÎñÆ÷½ø³Ì¡¢ºǫ́½ø³Ì¡£
Óû§½ø³Ì£ºÓû§Á¬½ÓÊý¾Ý¿âʱ»á´´½¨Ò»¸öÓû§½ø³Ì£¬¸Ã½ø³ÌÓÃÓںͷþÎñÆ÷½øÐлỰ£¬ÏòÊý¾Ý¿â·þÎñÆ÷·¢ÉúÇëÇ󣬽ÓÊÕÊý¾Ý¿âµÄÏìÓ¦¡£
·þÎñÆ÷½ø³Ì£ºÓÉORACLEÊý¾Ý¿â·þÎñÆ÷ ......

oracle´æ´¢¹ý³ÌʵÀý

ÈÏʶ´æ´¢¹ý³ÌºÍº¯Êý
´æ´¢¹ý³ÌºÍº¯ÊýÒ²ÊÇÒ»ÖÖPL/SQL¿é£¬ÊÇ´æÈëÊý¾Ý¿âµÄPL/SQL¿é¡£µ«´æ´¢¹ý³ÌºÍº¯Êý²»Í¬ÓÚÒѾ­½éÉܹýµÄPL/SQL³ÌÐò£¬ÎÒÃÇͨ³£°ÑPL/SQL³ÌÐò³ÆΪÎÞÃû¿é£¬¶ø´æ´¢¹ý³ÌºÍº¯ÊýÊÇÒÔÃüÃûµÄ·½Ê½´æ´¢ÓÚÊý¾Ý¿âÖеġ£ºÍPL/SQL³ÌÐòÏà±È£¬´æ´¢¹ý³ÌÓкܶàÓŵ㣬¾ßÌå¹éÄÉÈçÏ£º
* ´æ´¢¹ý³ÌºÍº¯ÊýÒÔÃüÃûµÄÊý¾Ý¿â¶ÔÏóÐÎʽ´æ´¢ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ