oracle´¥·¢Æ÷²åÈëÎÊÌâ - Oracle / ¸ß¼¶¼¼Êõ
ÎÒÓÐÁ½¸ö±í£¨A±íºÍB±í£©£¬»ú¹¹ÍêÈ«Ïàͬ£ºA ±í½¨Á¢´¥·¢Æ÷ µ±insert into A(id,name) values('1','zhangsan'); ÎÒÖ»Ï뽫name=zhangsanµÄʱºò½«insertÓï¾ä²åÈëµ½B±íÖжøA±í²»Ö´ÐвÙ×÷Õâ¸ö´¥·¢Æ÷Ó¦¸ÃÔõôʵÏÖÄØ£¿ È磺 if :nve.name=¡®zhangsan' then insert into B(id,name) values(:nve.id,:nve.name); end if; ¿ÉÊÇÏñÎÒÕâôдÕâÁ½¸ö±í¶¼ÓÐÊý¾Ýѽ£¬ÎÒÖ»ÏëÈÃB±íÖÐÓÐÊý¾Ý¶øA±íûÓУ¬Õâ¸ö´¥·¢Æ÷Ó¦¸ÃÔõÃ´Ð´ÄØ£¬Ð»Ð»¸øÎ»ÁË
ɾ³ýµôA±íÊý¾ÝÒýÓà ɾ³ýµôA±íÊý¾Ý ²»ºÃÒâ˼ÎÒÊǸöÐÂÊÖ£¬ÄÇÎÊÒ»ÏÂÔõôɾ³ýÄØ£¬ÊÇ·ñ»¹ÓбðµÄ·½·¨£¬ Äã¿ÉÒÔÔÚABµÄ»ù´¡ÉϽ¨¸öÊÓͼ£¬ÔÚÊÓͼÉϼÓinstead of´¥·¢Æ÷£¬µ±insertÊÓͼµÄʱºò£¬Ñ¡ÔñÊDzåA±í»¹ÊÇB±í¡£ÒýÓà SQL codecreatetable a (idnumber, namevarchar2(30));createtable b (idnumber, namevarchar2(30));createview vaasselect id, namefrom a;createorreplacetrigger trig_va insteadofinserton vafor each rowbeginif :new.name='zhangsan'theninsertinto bvalues (:new.id, :new.name);elseinsertinto avalues (:new.id, :new.name);endif;end;insertinto vavalues (1,'zhangsan');insertinto vavalues (2,'lisi');select*from a; ID NAME---------- ---------------------------------------------2 lisiselect*from b; ID NAME---------- ---------------------------------------------1 zhangsan 這ÊÇora-04091 table is mutating trigger function may not see itµÄ問題£¬±È較難處Àí¡£ 現ÔÚ還ÔÚÑÐ
Ïà¹ØÎÊ´ð£º
private static final String URL = "jdbc:oracle:thin:@localhost:1521:orcl"; private static final String USERNAME = "sys"; private static final String PASSWORD = "s ......
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£ ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î date(Ö÷) outid(Ö÷) inid(Ö÷) num amt 2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
¸÷λ´ó¸ç£¬°ï¸öæ¡£ ϸöOracle for vista °æ±¾µÄ°²×°ÊÔÊÔ 10GºÍ11GµÄ http://www.oracle.com/technology/software/products/database/index.html ------------------------------------------- ......
eclipse 3.3Æô¶¯web¹¤³Ì£¬ÒªÁ¬½Óoracle9iÊý¾Ý¿â±¨ ÑÏÖØ: Cannot create PoolableConnectionFactory (Listener refused the connection with the following error: ORA-12518, TNS:listener could not hand off cli ......