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

Oracle ×ÔÔö³¤×Ö¶Î

½¨SEQUENCEÐòÁР
CREATE SEQUENCE  ÐòÁÐÃû×Ö£¨ÀýÈ磺"URLIMAGE_SEQ"£©  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 101 CACHE 10 NOORDER  NOCYCLE ;
 
½¨trigger ´¥·¢Æ÷
create or replace trigger ´¥·¢Æ÷Ãû×Ö£¨ÀýÈ磺URLIMAGE_TRI £©
  before insert
    on Ó³ÉäµÄ±íÃû£¨ÀýÈ磺URLIMAGE £©
    for each row
begin
  select  ¸Õ½¨µÄÐòÁÐÃû£¨ÀýÈ磺URLIMAGE_seq£©.nextval into :new.Ôö³¤×Ö¶ÎÃû£¨ÀýÈ磺PICID£© from dual;
end;
ͨ¹ý´´½¨ÐòÁÐÀ´ÊµÏÖ
ORACLE SEQUENCEµÄ¼òµ¥½éÉÜ
ÔÚoracleÖÐsequence¾ÍÊÇËùνµÄÐòÁкţ¬Ã¿´ÎÈ¡µÄʱºòËü»á×Ô¶¯Ôö¼Ó£¬Ò»°ãÓÃÔÚÐèÒª°´ÐòÁкÅÅÅÐòµÄµØ·½¡£
1¡¢Create Sequence
ÄãÊ×ÏÈÒªÓÐCREATE SEQUENCE»òÕßCREATE ANY SEQUENCEȨÏÞ£¬
CREATE SEQUENCE emp_sequence
INCREMENT BY 1 -- ÿ´Î¼Ó¼¸¸ö
START WITH 1 -- ´Ó1¿ªÊ¼¼ÆÊý
NOMAXVALUE -- ²»ÉèÖÃ×î´óÖµ
NOCYCLE -- Ò»Ö±ÀÛ¼Ó£¬²»Ñ­»·
CACHE 10;
Ò»µ©¶¨ÒåÁËemp_sequence£¬Äã¾Í¿ÉÒÔÓÃCURRVAL£¬NEXTVAL
CURRVAL=·µ»Ø sequenceµÄµ±Ç°Öµ
NEXTVAL=Ôö¼ÓsequenceµÄÖµ£¬È»ºó·µ»Ø sequence Öµ
±ÈÈ磺
emp_sequence.CURRVAL
emp_sequence.NEXTVAL
¿ÉÒÔʹÓÃsequenceµÄµØ·½£º
- ²»°üº¬×Ó²éѯ¡¢snapshot¡¢VIEWµÄ SELECT Óï¾ä
- INSERTÓï¾äµÄ×Ó²éѯÖÐ
- NSERTÓï¾äµÄVALUESÖÐ
- UPDATE µÄ SETÖÐ
¿ÉÒÔ¿´ÈçÏÂÀý×Ó£º
INSERT INTO emp VALUES
(empseq.nextval, 'LEWIS', 'CLERK',7902, SYSDATE, 1200, NULL, 20);
SELECT empseq.currval from DUAL;
µ«ÊÇҪעÒâµÄÊÇ£º
- µÚÒ»´ÎNEXTVAL·µ»ØµÄÊdzõʼֵ£»ËæºóµÄNEXTVAL»á×Ô¶¯Ôö¼ÓÄ㶨ÒåµÄINCREMENT BYÖµ£¬È»ºó·µ»ØÔö¼ÓºóµÄÖµ¡£CURRVAL ×ÜÊÇ·µ»Øµ±Ç°SEQUENCEµÄÖµ£¬µ«ÊÇÔÚµÚÒ»´ÎNEXTVAL³õʼ»¯Ö®ºó²ÅÄÜʹÓÃCURRVAL£¬·ñÔò»á³ö´í¡£Ò»´ÎNEXTVAL»áÔö¼ÓÒ»´ÎSEQUENCEµÄÖµ£¬ËùÒÔÈç¹ûÄãÔÚͬһ¸öÓï¾äÀïÃæʹÓöà¸öNEXTVAL£¬ÆäÖµ¾ÍÊDz»Ò»ÑùµÄ¡£Ã÷°×£¿
- Èç¹ûÖ¸¶¨CACHEÖµ£¬ORACLE¾Í¿ÉÒÔÔ¤ÏÈÔÚÄÚ´æÀïÃæ·ÅÖÃһЩsequence£¬ÕâÑù´æÈ¡µÄ¿ìЩ¡£cacheÀïÃæµÄÈ¡Íêºó£¬oracle×Ô¶¯ÔÙÈ¡Ò»×éµ½cache¡£ ʹÓÃcache»òÐí»áÌøºÅ£¬ ±ÈÈçÊý¾Ý¿âͻȻ²»Õý³£downµô£¨shutdown abort),cacheÖеÄsequence¾Í»á¶ªÊ§. ËùÒÔ¿ÉÒÔÔÚcreate sequenceµÄʱºòÓÃnocache·ÀÖ¹ÕâÖÖÇé¿ö¡£
2¡¢Alter Sequence
Äã»ò


Ïà¹ØÎĵµ£º

oracle clob ºÍblobÎÊÌâµÄ½â¾ö

oracle clob ºÍblobÎÊÌâµÄ½â¾ö
 
ÕûÀíÁËoracle clob ºÍblobÎÊÌâµÄ½â¾ö°ì·¨£º
1£º½¨ÒéʹÓÃoracle 10µÄojdbc14.jar,·ñÔòµ±±£´æclobµÄʱºò¿ÉÄÜ»á³öÏÖÌ×½Ó×Ö´íÎó£» 
2£ºspringÅäÖÃÈçÏ£º 
java´úÂë: 
        <bean id="sessionFact ......

WIN7ÏÂÔõÑù×°Oracle 10g

      
WIN7µÄϵͳ½çÃæºÜƯÁÁ£¬Ê¹ÓÃÆðÀ´È·ÊµºÜ²»´í£¬¿ÉÊÇÈ´Ò²¸øÎÒµÄѧϰ´øÀ´¹ý²»ÉÙÂé·³¡£ÓÈÆäÊÇÕâ´Î×°Oracle£¬±ðÈËÓõÄÊÇXPµÄϵͳºÜÈÝÒ×¾Í×°ÉÏÁ˵ģ¬¿ÉÊÇÎÒÈ´ÔõôҲװ²»ÉÏ¡£ÎªÁËÈÃͬÑùϲ°®WIN7µÄÅóÓÑÉÙ×ßЩÍä·£¬ÏÂÃæ¾Í½éÉÜÒ»ÏÂÔÚwin7ÉÏ°²×°Oracle10gµÄ·½·¨°É£¬ÄÇ¿ÉÊDZ¾ÈËÓÃÁË8Ììʱ¼ä£¬²»Í ......

oracleÖÐnvarchar2×Ö·û¼¯²»Æ¥Åä

oracleµ±¶à±íunionʱÓöµ½nvarchar2ÀàÐÍʱ±¨´í ×Ö·û¼¯²»Æ¥Åä
¶ÔʹÓÃnvarcharµÄµØ·½£¬¼ÓÉÏ to_char( nvarchar µÄ±äÁ¿»ò×ֶΠ)
È磺
select to_char(name),price from aa
union all
select  to_char(name),price from bb
3Õűíaa,bb,cc¶¼ÓÐ name price ×ֶΠ²éѯ¼Û¸ñ×î¸ßµÄÇ°3λÐÕÃû
select * from(select to_ch ......

OracleÖÐÊÂÎñ¹ÜÀíµÄ¸ÅÄî


ÔÚOracleÖÐÒ»¸öÊÂÎñÊÇÓÉÒ»¸ö¿ÉÖ´ÐеÄSQLÓï¾ä¿ªÊ¼£¬Ò»¸ö¿ÉÖ´ÐÐSQLÓï¾ä²úÉú¶ÔʵÀýµÄµ÷Óá£ÔÚÊÂÎñ¿ªÊ¼Ê±£¬±»¸³¸øÒ»¸ö¿ÉÓûعö¶Î£¬¼Ç¼¸ÃÊÂÎñµÄ»Ø¹öÏî¡£Ò»¸öÊÂÎñÒÔÏÂÁÐÈκÎÒ»¸ö³öÏÖ¶ø½áÊø¡£
¡ôµ±COMMIT»òROLLBACK£¨Ã»ÓÐSAVEPOINT×Ӿ䣩Óï¾ä·¢³ö¡£
¡ôÒ»¸öDDLÓï¾ä±»Ö´ÐС£ÔÚDDLÓï¾äÖ´ÐÐÇ°¡¢ºó¶¼ÒþʽµØÌá½»¡£
¡ôÓû§³·Ïû¶ÔOra ......

OracleÖÐÎÄÈ«ÎÄË÷Òý

OracleÈ«ÎÄË÷ÒýµÄ»ù±¾ÖªÊ¶
Ò»¡¢ÀúÊ·±³¾°
OracleÊý¾Ý¿âµÄÈ«ÎļìË÷¼¼ÊõÒѾ­·Ç³£ÍêÃÀ£¬Oracle TextʹOracle9i¾ß±¸ÁËÇ¿´óµÄÎı¾¼ìË÷ÄÜÁ¦ºÍÖÇÄÜ»¯µÄÎı¾¹ÜÀíÄÜÁ¦¡£Oracle TextÊÇOracle9i²ÉÓõÄÐÂÃû³Æ£¬ÔÚOracle8/8iÖÐËü±»³Æ×÷Oracle interMedia Text£¬ÔÚOracle8ÒÔÇ°ËüµÄÃû³ÆÊÇOracle ConText Cartridge¡£
¶þ¡¢Oracle Text Ë÷Ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ