oracle ´¥·¢Æ÷ÎÊÌâ - Oracle / ¸ß¼¶¼¼Êõ
SQL code:
create or replace trigger article_log_file
after update or delete or insert
on article
for each row
begin
if updating then
insert into log_file values
(old.authorID,'update',old.artcleName,sysdate);
else if deleting then
insert into log_file values
(old.authorID,'delete',old.artcleName,sysdate);
else if inserting then
insert into log_file values
(new.authorID,'insert',new.artcleName,sysdate);
end if;
end;
ËäÈ»Óï¾äÖ´ÐÐÁË£¬µ«±àÒëÆ÷Ìáʾ±àÒë´øÓдíÎ󣬶øÇÒÎÒ²åÈëʱҲ³öÏÖÁË´íÎó£¬ÍûÖ¸½Ì£¬³õѧ¡¡
ÎÒÊýÁËÏ£¬end if Ö»ÓÐÒ»¸ö£¬if È´ÓÐ3¸ö¡£
if ÒªÓë end if Æ¥Åä
else if ¸ÄΪ elsif ÊÔÊÔ
PL/SQL ifÓï¾äÓï·¨
if <Ìõ¼þ1> then
<Óï¾ä1>;
elsif <Ìõ¼þ2> then
<Óï¾ä2>;
elsif <Óï¾ä3> then
....
else
<Óï¾än>;
end if;
2Â¥»¹²»Ë¯¾õ£¿ ¹»ÇڷܵÄ
ÎÒ˯¾õÈ¥
create or replace trigger article_log_file
after update or delete or insert
on article
for each row
begin
if updating then
insert into log_file values
(old.authorID,'update',old.artcleName,sysdate);
elseif deleting then
insert into log_file values
(old.authorID,'delete',old.artcleName,sy
Ïà¹ØÎÊ´ð£º
ÎÒÔÚ¿ª·¢µÄÕâ¸öÓ¦Óò¢·¢ÐԱȽϸߣ¬oracle¸üÐÂÊý¾ÝʱºòÈçºÎ´¦Àí²¢·¢´¦ÀíÄØ£¿¸÷λ´óÏÀ·¢±íºÃµÄ¹Ûµã°¡£¬ÔÚÏߵȴý£¡
oracleÊý¾Ý¸üÐÂʱ£¬»á×Ô¶¯Ä¬ÈÏÐÐËø¶¨£¬Â¥Ö÷²»Òª²ÙÐÄ£¬Oracle¶Ô²¢Ðд¦ÀíÒѾºÜ³ÉÊìÁË
ÒýÓÃ
oracle ......
ÎÒÓÐÒ»¸öserver 2000ÀïµÄÊý¾Ý,ÏÖÔÚÏëתµ½oracleÊý¾Ý¿âÉÏÓÃ,²»ÖªµÀÓÐûÓиßÊÖÓмòµ¥ÓÖ¿ì½ÝµÄ·½·¨,ǰÌáÊDz»ÄܸÄÔÀ´oracleÀïµÄÔÓеÄÊý¾Ý¿â,Ö»ÄÜн¨
ÒýÓÃ
°²×°£Ï£Ò£Á£Ã£Ì£ÅµÄ£Ï£Ä£Â£Ã£¬È»ºóÓãӣѣ̡¡£Ó£Å£Ò£Ö£Å£ ......
oracleµÄ°²×°ºÍʹÓö¼ºÜÄÑÂð£¿ÔÀ´Ê²Ã´¶¼²»»áʱѧÁËMySQL£¬Ò²Ã»Ôõôѧ¹ý£¬¾Í×Ô¼º×°¼¸´Î£¬Óü¸Ï£¬¾Í´ïµ½ÁË´óÌåÄÜʹÓõij̶ÈÁË£¬¿ÉÊÇoracleµ½ÏÖÔÚ²»»á×°²»»áÓ㬲»»áÅ䣬ÎÒ¾ÍÏë×°¸öoracle£¬È»ºó½¨¸öÊý¾Ý¿â£¬ÀïÃæÓм¸Õ ......
--½¨Á¢Ò»¸ö°üÒÔ¶¨ÒåÒ»¸öÓαê
create or replace package PK_test
as
type cur_test is ref cursor;
end PK_test;
--½¨Á¢Ò»¸ö¹ý³Ì,ͨ¹ýÊäÈëJOBID£¬·µ»ØÒ»¸ö±í¼Ç¼£¨Óα꣩!
create or replace ......