ORACLEÊý¾Ý¿â±íµÄ²Ù×÷
×î½üæÓÚ¹«Ë¾µÄÏîÄ¿¿ª·¢£¬ºÜ¾ÃûÓÐÀ´csdnÁË¡£½ñÌìÎÞÊ£¬ÉÏÀ´Ð´µã¶«Î÷¡£¹©´ó¼Ò²Î¿¼£¬²»¶ÔµÄµØ·½»¹Ï£Íû´ó¼ÒÅúÆÀÖ¸Õý¡£
Ò»ÏÂÊǶÔoracleÊý¾Ý¿â±íµÄһЩ²Ù×÷Óï¾ä£º
ÒѾ½¨ºÃµÄ±íÌí¼Ó×Ö¶Î
alter table Tablename add(column1 varchar2(20) default 'Y',column2 number(7,2)...)
ɾ³ý×ֶΣº
alter table Tablename drop column assessment_methods
Ϊ×Ö¶ÎÌí¼Ó×¢ÊÍ£º
comment on column bill_result.bill_no is 'Ãû´Î';
Ð޸ıíµÄ×Ö¶ÎÃû³Æ
ALTER TABLE table_name RENAME COLUMN column1 TO column2;
--Ϊ±ítablename1 µÄis_deletedÁÐÌí¼ÓĬÈÏÖµ
alter table tablename1 modify is_deleted default 'N'
Ïà¹ØÎĵµ£º
ÒÔϼ¸ÖÖÔ¼Êø ¡¢²¢ Ò»Ò»Áо٣º
1.Ö÷¼üÔ¼Êø£º
Òª¶ÔÒ»¸öÁмÓÖ÷¼üÔ¼ÊøµÄ»°£¬ÕâÁоͱØÐëÒªÂú×ãµÄÌõ¼þ¾ÍÊÇ·Ö¿Õ
ÒòΪÖ÷¼üÔ¼Êø£º¾ÍÊǶÔÒ»¸öÁнøÐÐÁËÔ¼Êø£¬Ô¼ÊøÎª£¨·Ç¿Õ¡¢²»Öظ´£©
ÒÔÏÂÊÇ´úÂë Òª¶ÔÒ»¸öÁмÓÖ÷¼ü£¬ÁÐÃûΪid,±íÃûΪemp
¸ñʽΪ£º
alter table ±í¸ñÃû³Æ add constraint Ô¼ÊøÃû³Æ Ôö¼ÓµÄÔ¼ÊøÀàÐÍ £¨ÁÐÃû£©
À ......
£¨1£©oracleÊý¾Ý¿â±¸·ÝµÄµ¼Èë¶ÔÊý¾Ý¿âµÄ°æ±¾ÓÐÒªÇó£¬Ò²¼´Ô´Êý¾Ý¿â£¨µ¼³ö²úÉú±¸·ÝµÄÊý¾Ý¿â£©µÄ°æ±¾ÒªºÍÄ¿±êÊý¾Ý¿â£¨µ¼ÈëÊý¾Ý¿â£©µÄ°æ±¾Ò»Ö£¬·ñÔò¿ÉÄܵ¼Öµ¼Èëʧ°Ü¡£
£¨2£©±¸·ÝÖеÄÓû§Ãû£¨Êý¾Ý¿âµ¼³öʱËùʹÓõÄÓû§£©ºÍµ¼ÈëÊý¾Ý¿âµÄÓû§Ãû×îºÃÒ»Ñù£¬ÒòΪÓû§ÃûºÍ±í¿Õ¼äÃüÃûÓйØÏµ£¬Èç¹û²»Ò»Ñù£¬µ¼Èë¾Í²»ÄÜÒ»´ÎÍê³É¡£Ò²¾ÍÊÇ ......
°²×°£º
ÔËÐÐG:\install\setup.exe°²×°Oracle£¬µ«²»´´½¨Æô¶¯Êý¾Ý¿â
´´½¨Êý¾Ý¿â(ʹÓÃConfiguration And Migration Tools->DataBase Configuration Assistant)
´´½¨¼àÌý³ÌÐò(ʹÓÃConfiguration And Migration Tools->NetManager»òÕß Configuration And Migration Tools->Net Configuration Assistant)
´´½¨·þÎñ ......
1¡¢´´½¨±í
create table stud(
sid int,
sname varchar2(50),
age number,
score number(4,2))
²¢²åÈëһЩÊý¾Ý£¨×Ô¼ºÊÖ¶¯²åÈëһЩ°É£©
2¡¢´´½¨º¯Êý
create or replace function fun_getScores(
v_age in stud.age%type
)
return number
is ......
¡¡¡¡1.¾ø¶ÔÖµ
¡¡¡¡S:select abs(-1) value
¡¡¡¡O:select abs(-1) value from dual
¡¡¡¡2.È¡Õû(´ó)
¡¡¡¡S:select ceiling(-1.001) value
¡¡¡¡O:select ceil(-1.001) value from dual
¡¡¡¡3.È¡Õû£¨Ð¡£©
¡¡¡¡S:select floor(-1.001) value
¡¡¡¡O:select floor(-1.001) value from dual
¡¡¡¡4.È¡Õû£¨½ØÈ¡£©
¡¡¡¡ ......