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

Çë½ÌÒ»¸öoracle´æ´¢¹ý³ÌµÄÎÊÌâ - Oracle / »ù´¡ºÍ¹ÜÀí

´úÂëÈçÏ£º
create procedure putdraw
(ID char,money number)
as
vbalance number,vname char;
begin
select Bmoney,name into vbalance,vname from bankcheck
where CIN=ID;
if(vname is null) then
raise_application_error(-20000,'please create a zhanghao');
end if;
update bankcheck set Bmoney=Bmoney+money
where CIN=ID;
end;
/

ҪʵÏÖ¶Ôbankcheck´æÇ®£¬Èç¹ûûÓÐÕË»§¾ÍÐèÒªÖØÐ¿ªÐÂÕË»§£¬ÉÏÃæ³ö´í²»ÖªÔõô´¦Àí£¬Íû¸÷λ¸ßÊÖÖ¸µãÏÂ
ûÈË£¬×Ô¼º¶¥¶¥ÏÈ

if Äã¼ÓÀ¨ºÅÁË¡£

vname char;
¸Ä³ÉVARCHAR2(5)

½¨ÒéÓÃmerge
merge into tablea
using tableb
on (conditions)
when matched then
  update
  set ...
when not matched then
insert into
values (...)

¹Ø¼ü´íÎóÔÚÓÚÄ㶨ÒåµÄÁ½¸ö±äÁ¿Ö®¼ä²»ÄÜÓöººÅ·Ö¸ô¡£
SQL code:
SQL> create procedure putdraw
2 (ID char,money number)
3 as
4 vbalance number;
5 vname char;
6 begin
7 select Bmoney,name into vbalance,vname from bankcheck
8 where CIN=ID;
9 if(vname is null) then
10 raise_application_error(-20000,'please create a zhanghao');
11 end if;
12 update bankcheck set Bmoney=Bmoney+money
13 where CIN=ID;
14 end;
15 /

Procedure created
SQL> select * from bankcheck;

BMONEY NAME CIN
---------- -----


Ïà¹ØÎÊ´ð£º

OracleÀëÏß·ÃÎÊ---ÇóÖú - Oracle / »ù´¡ºÍ¹ÜÀí

´ó¼ÒºÃ,ÎÒÏÖÔÚ°Ñoracle·þÎñÆ÷ÉÏÃæµÄԭʼÎļþ,ÏÂÔØµ½±¾»úÁË.ÎÒÏëÔÚ±¾»ú·ÃÎÊÊý¾Ý¿âÔõôÉèÖð¡.ÊDz»ÊÇÀàËÆ¿ÉÒÔ½¨Á¢Ò»¸öʲôÐéÄâ·þÎñÆ÷À´ÊµÏÖ.Çë´ó¼Ò³ö³öÖ÷Òâ
ÒýÓÃ
    ´ó¼ÒºÃ,ÎÒÏÖÔÚ°Ñoracle·þÎñÆ÷ÉÏÃæ ......

Çë½ÌsqlÓï¾ä¡£ - Oracle / ¿ª·¢

ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
  ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......

Windows 7 ÔõÑù°²×°Oracle - Oracle / »ù´¡ºÍ¹ÜÀí

¸÷λ´ó¸ç£¬°ï¸öæ¡£

ϸöOracle for vista °æ±¾µÄ°²×°ÊÔÊÔ
10GºÍ11GµÄ 
http://www.oracle.com/technology/software/products/database/index.html 
------------------------------------------- ......

oracle 10g data guard - Oracle / »ù´¡ºÍ¹ÜÀí

×öÍædata guard ºó
ÔÚPrimary·þÎñÆ÷ Ö´ÐР
SQL>SELECT SEQUENCE#,APPLIED from V$ARCHIVED_LOG ORDER BY SEQUENCE#;
 SEQUENCE# APP
---------- ---
  13 NO
  13 YES ......

oracle ´æ´¢¹ý³ÌÖÐÓ¦ÓÃÊÂÎñµÄÎÊÌâ - Oracle / ¿ª·¢

SQL code:

CREATE OR REPLACE PROCEDURE usp_refreshTopN IS
BEGIN
--Îĵµ
INSERT INTO topnresource(resourceId,title,type,cover,brief,properUser,tag,clickAmount,createDate,topNCreateDate,organizat ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ