oracle ¹ØÓÚID×ÔÔöºÍÔÚÔÓÐIDµÄ»ù´¡ÉÏ×ÔÔö
ÎÒÊǸöÐÂÊÖ,ËùÒÔÓÐЩ˵µÄ¿ÉÄܻ᲻ºÃ,Ï£ÍûÔĶÁÕâÎÄÕµÄÈ˼ûÁ°¡.
Ò»°ã¹ØÓÚID×ÔÔöµÄÍøÉ϶¼ÓÐÁ˺ܶàÁË,ºÇºÇ^ÄÇÎҾͼòµ¥µÄ˵һÏÂ: ÏÈ´´½¨±í£¬ÔÙ´´½¨ÐòÁÐ:
create sequence ÐòÁÐÃû
minvalue 1(ÉèÖÃ1Ϊ×îСֵ)
maxvalues 1.0E28(orcale ĬÈÏ×î´óֵΪ1.0E28)
start with 1 ( ³õʼֵΪ1)
increment by 1 (²½³¤Îª1 ,Ò²¾ÍÊÇÿ´ÎÔö¼Ó1)
noorder (Õâ¸öÊÇÉèÖÃΪ ²»ÅÅÐò)
nocycle (Õâ¸öÊÇÉèÖÃΪ ²»Ñ»·)
nocache(Õâ¸öÊÇÉèÖÃΪ ûÓлº³å)
È»ºóÊÇ´´½¨Ò»¸ö´¥·¢Æ÷£º
create trigger ´¥·¢Æ÷Ãû before insert on ±íÃû for each row
as
begin
select ÐòÁÐÃû.nextval into :new.id from dual;
end;
ÕâÑùÒ»¸öID×ÔÔö±í¾Í´´½¨ÁË.
Ïà¹ØÎĵµ£º
Ò»£®ÒýÑÔ
ORACLEÊý¾Ý¿â×Ö·û¼¯£¬¼´OracleÈ«Çò»¯Ö§³Ö(Globalization Support)£¬»ò¼´¹ú¼ÒÓïÑÔÖ§³Ö£¨NLS£©Æä×÷ÓÃÊÇÓñ¾¹úÓïÑԺ͸ñʽÀ´´æ´¢¡¢´¦ÀíºÍ¼ìË÷Êý¾Ý¡£ÀûÓÃÈ«Çò»¯Ö§³Ö£¬ORACLEΪÓû§Ìṩ×Ô¼ºÊìϤµÄÊý¾Ý¿âĸÓï»·¾³£¬ÖîÈçÈÕÆÚ¸ñʽ¡¢Êý×Ö¸ñʽºÍ´æ´¢ÐòÁеȡ£Oracle¿ÉÒÔÖ§³Ö¶àÖÖÓïÑÔ¼°×Ö·û¼¯£¬ÆäÖÐoracle8 ......
´´½¨oracle job
oracle job¼ò½é
Ö÷ÒªµÄʹÓÃÇé¾°
¶¨Ê±ÔÚºǫִ́ÐÐÏà¹Ø²Ù×÷:ÈçÿÌìÍíÉÏ0µã½«Ò»ÕűíµÄÊý¾Ý±£´æµ½ÁíÒ»ÕűíÖÐ,2£º¶¨Ê±±¸·ÝÊý¾Ý¿âµÈ
Ê컯˵ÍòÊ¿ªÍ·ÄÑ£¬ÕâÀïÎÒÖ»¼òµ¥¼ÇÊöÒ»¸ö´´½¨Ò»¸ö¼òµ¥µÄjob
²½ÖèÈçÏ£º
1¡¢´´½¨Ò»Õűíg_test
create table G_TEST
(
ID NUMBER(1 ......
ÕâѧÆÚ×¼±¸»¨ÉÙÐíʱ¼äÑо¿Ò»ÏÂoracle£¬Ì¨Ê½»úµÄUbuntu²»Îȶ¨ÀÏ»µ£¬·ÅÆúÁËlinuxÉÏʹÓÃoracleµÄÏë·¨£¬ÔÚ×Ô¼º±Ê¼Ç±¾ÉÏ×°ÁËÒ»¸öoracle 10g express°æ±¾£¬Ñ§Ï°Ò»Ï¡£
±¾À´»¹ÏëÓÃÔƶËÐéÄ⻯һÏÂoracle£¬ÊµÑéʧ°Ü£¬ÀÏÀÏʵʵÈÃoracleÇÖÈëÎÒµÄϵͳ¡£¡£¡£囧
°²×°Íê ......
ÀûÓÃoracle×Ô´øµÄutl_file°ü¿ÉÒÔ·ÃÎÊ´ÅÅÌÎļþ£¬µ«ÓиöÏÞÖÆ--ÎÞ·¨·ÃÎÊÎļþ¼Ð£¿Ê²Ã´Òâ˼ÄØ£¿¾ÍÊÇ˵oracleÖ»ÄÜ·ÃÎÊÖ¸¶¨µÄÎļþ£¬¶ø²»ÄÜ·ÃÎÊÎļþ¼ÐϵÄδ֪Îļþ¡£ËùÒÔ£¬Èç¹ûҪͨ¹ýoracleÈ¥±éÀúijָ¶¨Â·¾¶ÏµÄËùÓÐÎļþ£¬sorry, impossible! µ«ÊÇ£¬ÓÐÒ»ÖÖÌæ´ú·½°¸¿ÉÒÔÖúÄãÒ»±ÛÖ®Á¦£¡
ÖÚËùÖÜÖªjavaÖ®FileÀàÖ¸ÏòµÄ¿ÉÒÔÊÇĿ¼Ҳ¿ÉÒÔÊ ......
Ëø
²éѯÆäËûÓû§µÄ±í <Óû§Ãû.±íÃû>
Ëø¶¨Ä£Ê½£º
Ðм¶Ëø
Ðб»ÅÅËûÐÔËø¶¨
ÔÚijÐеÄËø±»ÊÍ·Å֮ǰ£¬ÆäËûÓû§²»ÄÜÐ޸ĴËÐÐ
ʹÓÃcommit rollbackÃüÁîÊÍ·ÅËø
»ñÈ¡Ðм¶Ëø
ʹÓÃinsert¡¢updateÓï¾ä£¬×Ô¶¯ÉÏÐм¶Ëø
ʹÓÃselect...for update [of ÁÐÃû] Óï¾ä×Ô¶¯»ñÈ¡Ðм¶Ëø
ÔÚ±íµÄÒ»Ðлò¶àÐзÅÖÃÅÅËûËø£¬ÓÃÓÚ·ÀÖÎÆäË ......