Oracle PL\SQL²Ù×÷£¨¶þ£©
OracleµÄÊý¾ÝÀàÐÍ
1.×Ö·ûÀàÐÍ
•CHAR(n) ¶¨³¤×Ö·û´®£¬n×Ö½Ú£¬nµÄÈ¡Öµ·¶Î§£º1~2000×Ö½Ú¡£
•VARCHAR2(n) ¿É±ä³¤µÄ×Ö·û´®£¬¶¨ÒåʱӦָÃ÷×î´ó³¤¶È£¬È¡Öµ·¶Î§£º1~ 4000×Ö½Ú¡£
•LONG ¿É±ä³¤×Ö·ûÁУ¬×î´ó³¤¶ÈÏÞÖÆ2GB£¬Ò»ÖÖ½ÏÀϵÄÊý¾ÝÀàÐÍ£¬Öð½¥±»BLOB¡¢CLOB¡¢µÈ´ó¶ÔÏóÊý¾ÝÀàÐÍËùÈ¡´ú¡£
2.Êý×ÖÀàÐÍ
•NUMBER(m,n) ¿É±ä³¤µÄÊýÖµÁУ¬mÓÐЧÊý×ÖµÄλÊý£¬nСÊýµãÒÔºóµÄλÊý¡£
3.ÈÕÆÚÀàÐÍ
•DATE ´Ó¹«ÔªÇ°4712Äê1ÔÂ1ÈÕµ½¹«Ôª4712Äê12ÔÂ31ÈÕ¡£¶¨ÒåÖл¹°üÀ¨Ê±¼ä£¬Ê±¡¢·Ö¡¢Ã롣ĬÈϸñʽΪ:DD-MON-YY, È磺07-11ÔÂ-05±íʾ2005Äê11ÔÂ7ÈÕ¡£
4.´ó¶ÔÏóÀàÐÍ
•´ó¶ÔÏóÀàÐÍÊý¾ÝÖ÷ÒªÓÐ3ÖÖ£¬·Ö±ðÊÇBLOB¡¢CLOB¡¢NCLOB¡£×î´ó³¤¶È4GB£¬Ö÷ÒªÓÃÀ´±£´æ¸÷ÖֽϴóµÄÎļþ£¬È磺WORDÎļþ¡¢ÒôƵÎļþ¡¢ÊÓƵÎļþµÈ¡£
•BfileÊý¾ÝÀàÐÍ ÔÚÊý¾Ý¿âÍⲿ±£´æµÄ´óÐͶþ½øÖÆÎļþ£¬×î´ó³¤¶ÈÊÇ4GB¡£Oracle 9i¿ÉÒÔ¶ÁÈ¡¡¢²éѯBfile£¬µ«ÊDz»ÄÜдÈë¡£
CLOB:ÓÃÀ´´æ´¢µ¥×Ö½ÚµÄ×Ö·ûÊý¾Ý
¡¡¡¡NCLOB:ÓÃÀ´´æ´¢¶à×Ö½ÚµÄ×Ö·ûÊý¾Ý
¡¡¡¡BLOB£ºÓÃÓÚ´æ´¢¶þ½øÖÆÊý¾Ý
¡¡¡¡BFILE:´æ´¢ÔÚÎļþÖеĶþ½øÖÆÊý¾Ý£¬Õâ¸öÎļþÖеÄÊý¾ÝÖ»Äܱ»Ö»¶Á·Ã¡£µ«¸ÃÎļþ²»°üº¬ÔÚÊý¾Ý¿âÄÚ¡£
¡¡¡¡CLOB£¬NCLOB£¬BLOB¶¼ÊÇÄÚ²¿µÄLOBÀàÐÍ£¬×4G£¬Ã»ÓÐLONGÖ»ÄÜÓÐÒ»ÁеÄÏÞÖÆ
¡¡¡¡ÎÒÒª±£´æͼƬ¡¢Îı¾Îļþ¡¢WordÎļþ¸÷×Ô×îºÃÓÃÄÄÖÖÊý¾ÝÀàÐ͵Äѽ£¿
¡¡¡¡BLOB×îºÃ£¬LONGRAWÒ²²»´í£¬µ«LongÊÇoracle½«Òª·ÏÆúµÄÀàÐÍ£¬Òò´Ë½¨ÒéÓÃLOB¡£
Îı¾ÎļþVS¶þ½øÖÆÎļþ--http://www.cnblogs.com/mjgforever/archive/2008/02/27/1083584.html
OracleµÄÔËËã·û
1.ANY/SOME ±È½ÏÆäÖÐÈÎÒâÖµ£¬¸Ã·ûºÅÇ°±ØÐëÊDZȽÏÔËËã·û£¨= != < > <= >= £©¡£
SQL>select ename,sal
from emp
where sal<=any(860,1100);
2.ALL ±È½ÏÁгöÀ´µÄÿһ¸öÖµ£¬Ç°ÃæµÄ±È½Ï·û±ØÐëÊÇ= != < > <= >= ¡£
SQL>select ename,sal
from emp
where sal<=all(860,1100);
3.[NOT]NETWEEN m AND N
Èç¹ûÖµ´óÓÚ»òµÈÓÚmÇÒСÓÚ»òµÈÓÚn,Ôò·µ»ØTRUE ¡£
SQL>select ename,sal
from emp
where sal between 1000 and 1500;
4.[NOT] EXISTS
Èç¹û×Ó²éѯÀïÖÁÉÙ·µ»ØÒ»ÐÐÔòEXISTSΪTRUE¡£
SQL>select ename,sal
from emp
where exists(select * from emp where sal>8000);
5. [NOT] LIKE n
ÓÃÀ´·µ»ØÁÐ
Ïà¹ØÎĵµ£º
ѧϰOracle DBAÒ²°ë¸ö¶àѧÆÚÁË£¬½ñÌìÃÍÈ»²Å·¢ÏÖ£¬ÔÀ´ÎÒµÄÊ黹ÊǺÜеģ¬ÉϿβÙ×÷ʱºòÒ²Ö»ÊÇÖªµÀ´ó¸ÅÔõô×ö£¬µ«ÊÇÒªÕæµÄÈ«²¿×Ô¼º×ö£¬¶ø²»È¥·Ê黹ÊÇÓÐÒ»¶¨µÄÄѶȵģ¬ËùÒÔÄØ£¬½ñÌ쿪ʼ½«DBA´ÓÍ·¸´Ï°Ò»±é£¬Í¬Ê±ÔÙ²Ù×÷Ò»±é¡£
µÚÒ»Õ£¬Ñ§µÄÊÇOracleµÄÌåϵ½á¹¹£ ......
Ê×ÏÈÎÒÏëлл԰×ÓµÄÅóÓÑÃÇ£¬ÊÇÄãÃÇÌáÐÑÎÒдÄÚÈÝÓдíÎ󣬼ǵÃÔø¾µç×ÓÉÌÎñÖ®Êý¾Ý´æ´¢Á÷³Ì£¨Î壩ÀïÃæ˵µ½“Ñ¡´æ´¢¹ý³Ì+´«µÝ²ÎÊýÓÃSqlParameterÊÇÒòΪ£¬³ý·ÇÊÇADO.NETÓЩ¶´£¬ÄÇô¾Í¾ø¶Ô²»»á·¢ÉúSQL×¢È딡£Keep Walking´ó¸çÒ²ÔÚ¹ØÓÚ·ÀÖ¹sql×¢ÈëµÄ¼¸ÖÖÊֶΣ¨¶þ£©ÖоٳöÀ´Ò»¸öÀý×Ó˵Ã÷ÎÒ˵µÄÉϾ仰ÊÇ´íÎóµÄ¡£ËµÊµ»°µ± ......
if exists(select * from master.dbo.sysdatabases where name = 's2723103005')
begin
drop database s2723103005
print 'ÒÑɾ³ýÊý¾Ý¿âs2723103005'
end
create database s2723103005
on primary
(name=His_data,
filename = 'd:\database\his_data.mdf',
siz ......
1.OracleÔõÑù´æ´¢Îı¾
CHARºÍVARCHAR2µÄÇø±ð
•CHAR¶¨³¤×Ö·û´®£¬VARCHAR2±ä³¤×Ö·û´®¡£
•CHAR(n) ¶¨³¤×Ö·û´®£¬n×Ö½Ú£¬nµÄÈ¡Öµ·¶Î§£º1~2000×Ö½Ú¡£
•VARCHAR2(n) ¿É±ä³¤µÄ×Ö·û´®£¬¶¨ÒåʱӦָÃ÷×î´ó³¤¶È£¬È¡Öµ·¶Î§£º1~ 4000×Ö½Ú¡£
2. OracleÔõÑù´æ´¢ÊýÖµ
ÊýÖµÀàÐÍ˵Ã÷£º NUMBER£¨m , n£©
Êý×Ö ......