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

Oracle 開發筆記

Oracle Îï¼þµÄÃüÃûÏÞÖÆ
ÈκÎÎï¼þµÄÃû稱²»µÃ³¬過 30 λԪ(Bytes)
Oracle µÄ dummy query 寫·¨
SELECT SYSDATE from dual
Oracle 選È¡²¿·Ö資Áϵķ½·¨
SELECT * from table WHERE ROWNUM<10; /* È¡³öÇ° 10 筆 */
實現 Oracle ÉϵķÖ頁顯ʾ [¾«華]
Oracle 轉換³É數ÖµµÄ·½·¨
to_number('<string>')
to_number(null)   => 0
Oracle ÈÕÆÚ欄λ轉×Ö´®µÄ·½·¨
TO_CHAR(<date>, '<format>')
http://infolab.stanford.edu/~ullman/fcdb/oracle/or-time.html
範Àý£º
SELECT TO_CHAR(b, 'YYYY/MM/DD') AS b from x;
Oracle ×Ö´®轉ÈÕÆÚ欄λµÄ·½·¨ ( Oracle 寫ÈëÈÕÆڵķ½·¨ )
TO_DATE(<string>, '<format>')
範Àý£º
TO_DATE('2006/8/29', 'YYYY/MM/DD')
Oracle È¡µÃÄ¿Ç°時間µÄ×÷·¨
SYSDATE
Oracle 針對ÈÕÆÚ²Ù×÷µÄ·½·¨
±È對 DATE 欄λ時£¬¿ÉÒÔʹÓÃ標準µÄ數Öµ±È對運ËãÔª£¬ÀýÈ磺=, !=, >, µÈµÈ¡£
Äã¿ÉÒÔ針對 DATE 欄λֱ½ÓËùÏà減µÄ動×÷£¬結¹û會»Ø傳 FLOAT ¸ñʽ£¬Æä數ÖµÊÇ兩個ÈÕÆÚµÄÌì數¡£Ò»°ã來說£¬Ïà減ááµÄ數Öµ結¹û會ÓÐС數點£¬Òò為 DATE 欄λ¸ñʽ°üº¬¡¸時間¡¹µÄ³É·Ö¡£Òò´Ë£¬兩個ÈÕÆÚ欄λµÄ¡¸Ïà¼Ó¡¹¡¢¡¸Ïà³Ë¡¹¡¢¡¸Ïà³ý¡¹¶¼ÊDz»ÔÊ許µÄ£¡
µ«ÊÇ£¬ÈÕÆÚ(DATE)欄λ¿ÉÒÔ¸ú¡¸數Öµ¡¹欄λ¡¸Ïà¼Ó¡¹»ò¡¸Ïà減¡¹£¬Æ䡸數Öµ¡¹Ëù´ú±íµÄÒâ義ÊÇ¡¸Ïà²îµÄÌì數¡¹£¬ËùÒÔ SYSDATE + 1 µÄÒâ˼¾ÍÊÇ¡¸Ã÷Ì졹µÄÒâ˼¡£µ«ÈÕÆÚ欄λ²»Äܸú數Öµ欄λ¡¸Ïà³Ë¡¹»ò¡¸Ïà³ý¡¹¡£
ÈÕÆÚ欄λ¿ÉÒÔ͸過 TO_CHAR º¯數µÄ轉換變³É¡¸純×Ö´®¡¹£¬這樣Ò»來¾Í¿ÉÒÔÓá¸×Ö´®º¯數¡¹±È對ÈÕÆڵĸñʽÁË¡£ÀýÈ磺to_char(<date>, 'DD-MON-YY') like '%JUN%' ¾Í¿ÉÒÔ±È對³ö該ÈÕÆÚÊÇ·ñÔÚ¡¸ÁùÔÂ(JUN)¡¹¡£
½¨Á¢ TRIGGER Ö¸Áî×¢ÒâÊÂ項
SQL 語·¨µÄ×îááÃæÒ»¶¨Òª¼ÓÉÏ·Ö號(;)結β
ASP


Ïà¹ØÎĵµ£º

ORACLE ÓαêµÄʹÓÃ

declare cursor myCursor is select * from ±íÃû;
myRow myCursor%rowtype;
begin
open myCursor;
loop
fetch myCursor into myRow;
exit when myCursor%notfound;
--ÒªÖ´ÐеÄSQLÓï¾ä
end loop;
end; ......

¡¾×ª¡¿ Oracle±í½éÉÜ Ë÷Òý×éÖ¯±í

http://hi.baidu.com/wzbg/blog/item/005f9c098e31a12f6b60fbfb.html
Oracle±í½éÉÜ--Ë÷Òý×éÖ¯±í
2010-01-12 16:03
Ë÷Òý×éÖ¯±í(IOT)²»½ö¿ÉÒÔ´æ´¢Êý¾Ý£¬»¹¿ÉÒԴ洢Ϊ±í½¨Á¢µÄË÷Òý¡£Ë÷Òý×éÖ¯±íµÄÊý¾ÝÊǸù¾ÝÖ÷¼üÅÅÐòºóµÄ˳Ðò½øÐÐÅÅÁеģ¬ÕâÑù¾ÍÌá¸ßÁË·ÃÎʵÄËٶȡ£µ«ÊÇÕâÊÇÓÉÎþÉü²åÈëºÍ¸üÐÂÐÔÄÜΪ´ú¼ÛµÄ(ÿ´ÎдÈëºÍ¸üкó¶¼Òª ......

OracleÄÚ´æ·ÖÅ佨Òé


¹ØÓÚSGAÉèÖõÄÒ»µã×ܽá
±¾×ܽ᲻Õë¶ÔÌØÀý£¬½ö¶Ô·þÎñÆ÷Ö»´æÔÚOS + ORACLE ΪÀý£¬Èç¹û´æÔÚÆäËûÓ¦ÓÃÇë×ÃÇ鿼ÂÇ
дÕâ¸öÒ²ÊÇÒòΪ½üÀ´ÕâÖÖÖظ´ÐÔµÄÎÊÌâ·¢ÉúµÄÌ«¶àËùµ¼ÖµÄ
Ê×ÏȲ»ÒªÃÔÐÅSTS,SG,OCP,EXPERT µÈ¸ø³öµÄÈκν¨Òé¡¢ÄÚ´æ°Ù·Ö±ÈµÄ˵·¨
»ù±¾ÕÆÎÕµÄÔ­ÔòÊÇ£¬ data buffer ͨ³£¿ÉÒÔ¾¡¿ÉÄܵĴó£¬shared_pool_size ÒªÊÊ¶È ......

Oracle·ÖÒ³²éѯÓï¾ä


·ÖÒ³²éѯ¸ñʽ£º
SELECT * from 
(
SELECT A.*, ROWNUM RN 
from (SELECT * from TABLE_NAME) A 
WHERE ROWNUM <= 40
)
WHERE RN >= 21
ÆäÖÐ×îÄÚ²ãµÄ²éѯSELECT * from TABLE_NAME±íʾ²»½øÐз­Ò³µÄԭʼ²éѯÓï¾ä¡£ROWNUM <= 40ºÍRN >= 21¿ØÖÆ·ÖÒ³²éѯµÄÿҳµÄ·¶Î§¡£
ÉÏÃæ¸ø³öµÄÕâ¸ö·ÖÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ