Oracle Óαê Cursor ʹÓÃ
create or replace procedure getok
as
cursor mycur is select ids,name from aaa where name not in (select names from ok);
vempno aaa.ids%type;
vename aaa.name%type;
begin
open mycur;
loop
fetch mycur into vempno,vename;
exit when mycur%notfound;
if mycur%found then
insert into ok values(vempno,vename);
end if;
end loop;
dbms_output.put_line('I Found You!'||mycur%rowcount||'ÐÐ');
close mycur;
end getok;
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/lixianzhang0493/archive/2009/12/31/5109682.aspx
Ïà¹ØÎĵµ£º
ÎÒÃÇÖªµÀ,ÔÚOracleÊý¾Ý¿âÖÐ,¿ÉÒÔͨ¹ýkill sessionµÄ·½Ê½À´ÖÕÖ¹Ò»¸ö½ø³Ì,Æä»ù±¾Óï·¨½á¹¹Îª:
alter system kill session 'sid,serial#' ;
±»killµôµÄsession,״̬»á±»±ê¼ÇΪkilled,Oracle»áÔÚ¸ÃÓû§ÏÂÒ»´ÎtouchʱÇå³ý¸Ã½ø³Ì.
ÎÒÃÇ·¢ÏÖµ±Ò»¸ösession±»killµôÒԺ󣬸ÃsessionµÄpaddr±»Ð޸ģ¬Èç¹ûÓжà¸ösession±»kil ......
--Ãû´Ê˵Ã÷£ºÔ´——±»Í¬²½µÄÊý¾Ý¿â
-- Ä¿µÄ——Ҫͬ²½µ½µÄÊý¾Ý¿â
/*Ò»¡¢´´½¨dblink£º*/
--1¡¢ÔÚÄ¿µÄÊý¾Ý¿âÉÏ£¬´´½¨dblin
drop database link dblink_anson;
Create public
database link dblink_an ......
¾³£ÓÐͬÊÂ×ÉѯoracleÊý¾Ý¿â×Ö·û¼¯Ïà¹ØµÄÎÊÌ⣬ÈçÔÚ²»Í¬Êý¾Ý¿â×öÊý¾ÝÇ¨ÒÆ¡¢Í¬ÆäËüϵͳ½»»»Êý¾ÝµÈ£¬³£³£ÒòΪ×Ö·û¼¯²»Í¬¶øµ¼ÖÂÇ¨ÒÆÊ§°Ü»òÊý¾Ý¿âÄÚÊý¾Ý±ä³ÉÂÒÂë¡£ÏÖÔÚÎÒ½«oracle×Ö·û¼¯Ïà¹ØµÄһЩ֪ʶ×ö¸ö¼òµ¥×ܽᣬϣÍû¶Ô´ó¼Ò½ñºóµÄ¹¤×÷ÓÐËù°ïÖú¡£
¡¡¡¡Ò»¡¢Ê²Ã´ÊÇoracle×Ö·û¼¯
¡¡¡¡Oracle×Ö·û¼¯ÊÇÒ»¸ö×Ö½ÚÊý¾ÝµÄ½âÊ͵ķûºÅ¼¯ ......
1¡¢´æ´¢¹ý³ÌºÍº¯ÊýµÄÇø±ð¡£
£¨1£©¡¢´æ´¢¹ý³ÌÊÇ×÷ΪPL/SQLÓï¾äÖ´ÐУ¬¶øº¯ÊýÊÇ×÷Ϊ±í´ïʽµÄÒ»²¿·Öµ÷Óã»
£¨2£©¡¢´æ´¢¹ý³ÌÔÚ¹æ¸ñ˵Ã÷Öв»°üº¬returnÓï¾ä£¬¶øÔÚº¯ÊýµÄ¹æ¸ñ˵Ã÷Õâ°üº¬return×Ӿ䣻
(3)¡¢´æ´¢¹ý³Ì²»·µ»ØÖµ£¬¶øº¯Êý±ØÐë·µ»ØÖµ£»
£¨4£©¡¢ÔÚ´æ´¢¹ý³ÌÖпÉÒÔ°üº¬returnÓï¾ä£¬µ«²»·µ»ØÈκÎÖ ......