Oracle´¥·¢Æ÷
--´´½¨´¥·¢Æ÷£¨Ðм¶´¥·¢Æ÷£©
create or replace trigger tri_update_emp_bak
after update
on emp_bak
for each row --ÿ¸üÐÂÒ»ÐÐ ¾Í´¥·¢Ò»´Î
begin
--oracle ÀïÃæ ¶Ô´¥·¢Æ÷ Ò²ÌṩÁËÌØÊâµÄ¶ÔÏó :NEW :OLD À´·ÃÎÊ ¸üÐÂÇ°ºóµÄÊý¾Ý
dbms_output.put_line('¸üкó' || :NEW.sal);
dbms_output.put_line('¸üÐÂÇ°' || :OLD.sal);
if updating then
end if;
if inserting
end;
--´´½¨´¥·¢Æ÷£¨Ðм¶´¥·¢Æ÷£©£¨Ç°Öã©
create or replace trigger tri3_update_emp_bak
before update
on emp_bak
for each row --ÿ¸üÐÂÒ»ÐÐ ¾Í´¥·¢Ò»´Î
begin
--oracle ÀïÃæ ¶Ô´¥·¢Æ÷ Ò²ÌṩÁËÌØÊâµÄ¶ÔÏó :NEW :OLD À´·ÃÎÊ ¸üÐÂÇ°ºóµÄÊý¾Ý
dbms_output.put_line('¸üкó' || :NEW.sal);
dbms_output.put_line('¸üÐÂÇ°' || :OLD.sal);
end;
select * from emp_bak
update emp_bak set sal = 1000 where empno in (7788)
--´´½¨´¥·¢Æ÷£¨±í¼¶´¥·¢Æ÷£©
--//±í¼¶±ð´¥·¢Æ÷ÀïÃæ ²»ÔÊÐíʹÓà :NEW :OLD ±äÁ¿
create or replace trigger tri2_update_emp_bak
after update
on emp_bak
begin
-- dbms_output.put_line('¸üкó' || :NEW.sal);
--dbms_output.put_line('¸üÐÂÇ°' || :OLD.sal);
end;
--´´½¨´¥·¢Æ÷£¨Ðм¶´¥·¢Æ÷£©
create or replace trigger tri4_update_emp_bak
after update of sal
on emp_bak
for each row --ÿ¸üÐÂÒ»ÐÐ ¾Í´¥·¢Ò»´Î
begin
--oracle ÀïÃæ ¶Ô´¥·¢Æ÷ Ò²ÌṩÁËÌØÊâµÄ¶ÔÏó :NEW :OLD À´·ÃÎÊ ¸üÐÂÇ°ºóµÄÊý¾Ý
dbms_output.put_line('¸üкó' || :NEW.sal);
dbms_output.put_line('¸üÐÂÇ°' || :OLD.sal);
end;
create table userinfo
(
userid number(4) primary key,
username varchar2(20)
)
create table addrinfo
(
addrid number(4) primary key,
addname varchar2(20),
userid number(4) references userinfo(userid)
)
insert into userinfo values (1,'ÀîËÄ')
insert into addrinfo values (1,'ºþ±±Î人',1)
select * from addrinfo
delete from userinfo where userid =1
--¼¶ÁªÉ¾³ý
create or replace trigger tri_userinfo_delete
before delete
on userinfo
for each row
begin
del
Ïà¹ØÎĵµ£º
ORACLE SQLÐÔÄÜÓÅ»¯ÏµÁÐ
1. ·ÃÎÊTableµÄ·½Ê½
ORACLE ²ÉÓÃÁ½ÖÖ·ÃÎʱíÖмǼµÄ·½Ê½:
a. È«±íɨÃè
È«±íɨÃè¾ÍÊÇ˳ÐòµØ·ÃÎʱíÖÐÿÌõ¼Ç¼. ORACLE²ÉÓÃÒ»´Î¶ÁÈë¶à¸öÊý¾Ý¿é(database block)µÄ·½Ê½ÓÅ»¯È«±íɨÃè.
b. ͨ¹ýROWID·ÃÎʱí
Äã¿ÉÒÔ²ÉÓûùÓÚROWIDµÄ·ÃÎÊ·½Ê½Çé¿ö,Ìá¸ß·ÃÎʱíµÄЧÂÊ, , ROWID°üº¬Á˱íÖмǼµ ......
package com.svse.dao;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UserDAO {
/*
* javaµ÷Óô洢¹ý³Ì
*/
public int addUser(String username,int userage)
{
Connection conn = null;
int useri ......
ÔÎĵØÖ·£ºhttp://oracle.chinaitlab.com/induction/725752.html
Ò»¡¢logminerµÄÓÃ;
¡¡¡¡ÈÕÖ¾ÎļþÖдæ·Å×ÅËùÓнøÐÐÊý¾Ý¿â»Ö¸´µÄÊý¾Ý£¬¼Ç¼ÁËÕë¶ÔÊý¾Ý¿â½á¹¹µÄÿһ¸ö±ä»¯£¬Ò²¾ÍÊǶÔÊý¾Ý¿â²Ù×÷µÄËùÓÐDMLÓï¾ä¡£
¡¡¡¡logminer ¹¤¾ß¼´¿ÉÒÔÓÃÀ´·ÖÎöÔÚÏߣ¬Ò²¿ÉÒÔÓÃÀ´·ÖÎöÀëÏßÈÕÖ¾Îļþ£¬¼´¿ÉÒÔ·ÖÎö±¾Éí×Ô¼ºÊý¾Ý¿âµÄÖØ×÷ÈÕÖ¾ÎÄ ......
Ç°Ìì×°ºÃµÄ£Ï£ò£á£ã£ì£å£¬×òÌìͻȻ²»ºÃÓÃÁË£¬´ÓOracleµÄ´íÎóÌáʾÀ´¿´,ÊÇ˵TNS:no listener £¬¹À¼ÆÊÇijÖÖ·þÎñûÓÐÆô¶¯£¬´ò¿ªwindows¹ÜÀí¹¤¾ß->·þÎñ£¬Ò»¿´£¬ÓÐÒ»¸öOracleOraHome90TNSListenerÕâÑùµÄ·þÎñ£¬ºÍ´íÎóÐÅÏ¢ÌâÊÇÒ»Ö£¬»ù±¾¾Í¿ÉÒԿ϶¨ÊÇÕâ¸ö·þÎñËùÒý·¢µÄÎÊÌâ¡£ÔÙÒ»¿´£¬¸Ã·þÎñûÓÐÆô¶¯£¬ËìÊÖ¹¤Æô¶¯£¬Ë¢ÐºóÒ»¿´£¬¸Ã· ......