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

Oracle Ðм¶´¥·¢Æ÷ѧϰ

 Oracle ´¥·¢Æ÷ÓÐÓï¾ä¼¶´¥·¢Æ÷ºÍÐм¶´¥·¢Æ÷
Óï¾ä¼¶´¥·¢Æ÷  µ±É¾³ý²¿ÃűíÖеIJ¿ÃźÅʱ£¬Í¬Ê±É¾³ýµôÔ±¹¤±íÖв¿ÃźÅΪ£ºold.deptnoµÄ¼Ç¼
create or replace trigger del_dept_id
after delete on dept
for each row
begin
delete from emp where deptno=:old.deptno;
end;
µ±Íù²¿Ãűí²åÈëʱ£¬Í¬Ê±ÔÚÔ±¹¤±íÖвåÈëÒ»¾ä£¬ÆäÖУºnew.deptno Ϊ²åÈëµÄ²¿ÃűàºÅ
create or replace trigger insert_dept
after insert on dept
for each row
begin
insert into emp(empno,ename,job,mgr,sal,hiredate,deptno) values('1234','JAMES','job',7566,3456,sysdate,:new.deptno);
end;
ÐÞ¸Äʱ£º
 create or replace trigger update_dept
 after update on dept
 for each row
 begin
 update emp set deptno=:new.deptno  where deptno=:old.deptno;
 end;
/
ÉÏÃæµÄnew ±íºÍold±íÊÇÔÚÄÚ´æµ±ÖеÄ
ÎÒÃǶÔÄĸö±í½øÐÐÁËdeleteÄÇôold±í¾ÍºÍËûµÄ½á¹¹Ò»Ñù
ÎÒÃǶÔÄĸö±í½øÐÐÁËinsertÄÇônew±í¾ÍºÍËûµÄ½á¹¹Ò»Ñù
²åÈëÊý¾ÝʱºòÏȲåÈëµ½new±íÖУ¬È»ºóÔÚ²åÈëʵ¼ÊµÄ±íÖÐ
ɾ³ýÊý¾ÝʱºòÏÈ°ÑÊý¾Ý·ÅÔÚold±íÖУ¬Ìá½»ºóÔÚ´Óold±íÖÐɾ³ý
insertÉæ¼°new±í
deleteÉæ¼°old±í
updateÉæ¼°oldºÍnew±í
´¥·¢Æ÷Öв»ÄÜдrollbackÒ²²»ÄÜдDBMS_OUTPUT.PUTLINE


Ïà¹ØÎĵµ£º

MYSQLºÍORACLEµÄһЩ²Ù×÷Çø±ð

ÓкܶàÓ¦ÓÃÏîÄ¿, ¸ÕÆð²½µÄʱºòÓÃMYSQLÊý¾Ý¿â»ù±¾ÉÏÄÜʵÏÖ¸÷ÖÖ¹¦ÄÜÐèÇó£¬Ëæ×ÅÓ¦ÓÃÓû§µÄÔö¶à£¬Êý¾ÝÁ¿µÄÔö¼Ó£¬MYSQL½¥½¥µØ³öÏÖ²»¿°ÖظºµÄÇé¿ö£º
Á¬½ÓºÜÂýÉõÖÁå´»ú£¬ÓÚÊǾÍÓаÑÊý¾Ý´ÓMYSQLǨµ½ORACLEµÄÐèÇó£¬Ó¦ÓóÌÐòÒ²ÒªÏàÓ¦×öһЩÐ޸ġ£±¾ÈË×ܽá³öÒÔϼ¸µã×¢ÒâÊÂÏϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1£® ×Ô¶¯Ôö³¤µÄÊý¾ÝÀàÐ ......

SQLServerºÍOracleµÄ³£Óú¯Êý¶Ô±È

SQLServerºÍOracleµÄ³£Óú¯Êý¶Ô±È
¡¡¡¡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) valu ......

sqlserver:openrowset / oracle:table/view@dblinkÃû

Ö»ÊÇsqlserver ÌṩµÄÔ¶³ÌÊý¾Ý·ÃÎʺ¯Êý;  ÔÚ±¾µØsqlserver ÖÐÈ¡ÍⲿÊý¾ÝÔ´Êý¾Ýʱºò¿ÉÓÃ;
¶ÔÁ¬½Ó±¾µØ oracle ²Ù×÷Ô¶³Ì oracle ²»ÄÜʹÓÃ; ²âÊÔ: pl/sql ÖÐʹÓÃ:
select * from openrowset(................); ÎÞЧ!!!!!!!!!!!!!!
ÔÚoracle ÖÐÐèÒª·ÃÎÊÔ¶³ÌÊý¾Ý,ÐèÒª½¨Á¢Ò»Á¬½ÓÔ¶³Ìoracle µÄ dblink ;
ÔÙÓÃÈçÏ·½ ......

¹ØÓÚoracleµ¼Èësqlserver´æÔÚµÄΨһË÷ÒýÎÊÌâ

ÎÒÔÚ°ÑoracleÊý¾Ýµ¼ÈësqlserverÖÐʱ£¬·¢ÏÖÔÚoracleÖÐ×ֶζ¨ÒåΪΨһË÷Òýʱ£¬²»Í¬¼Ç¼µÄ´Ë×Ö¶ÎÈç¹ûΪ¿Õ²»±»ÈÏΪÊÇÖظ´µÄ£¬µ«ÔÚsqlserverÖÐÈç¹û´Ë×Ö¶ÎΪΨһË÷Òý×ֶΣ¬²»ÔÊÐíÓÐ2¸öÒÔÉϵĿÕÖµ¡£ÓôÃÆ¡£ËùÒÔÖ»ºÃ½«sqlserverÖеÄΨһË÷Òý×Ö¶ÎÊÖ¹¤ÐÞ¸ÄΪ¼¸¸ö·Ç¿ÕµÄÖµ£¬µ«ÕâÑù³ÌÐò¿Ï¶¨Òª½øÐÐÐÞ¸ÄÁË¡£ÐèÒªÔÚ³ÌÐòÖÐΪ´Ë×Ö¶ÎÉèÖò»Öظ´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ