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

oracleµÄ´æ´¢¹ý³ÌºÍÓαê


OracleÖеĴ洢¹ý³ÌºÍÓαê:
select myFunc(²ÎÊý1,²ÎÊý2..) to dual; --¿ÉÒÔÖ´ÐÐһЩҵÎñÂß¼­
Ò»:OracleÖеĺ¯ÊýÓë´æ´¢¹ý³ÌµÄÇø±ð:
A:º¯Êý±ØÐëÓзµ»ØÖµ,¶ø¹ý³ÌûÓÐ.
B:º¯Êý¿ÉÒÔµ¥¶ÀÖ´ÐÐ.¶ø¹ý³Ì±ØÐëͨ¹ýexecuteÖ´ÐÐ.
C:º¯Êý¿ÉÒÔǶÈëµ½SQLÓï¾äÖÐÖ´ÐÐ.¶ø¹ý³Ì²»ÐÐ.
ÆäʵÎÒÃÇ¿ÉÒÔ½«±È½Ï¸´ÔӵIJéѯд³Éº¯Êý.È»ºóµ½´æ´¢¹ý³ÌÖÐÈ¥µ÷ÓÃÕâЩº¯Êý.
¶þ:ÈçºÎ´´½¨´æ´¢¹ý³Ì:
A:¸ñʽ
create or replace procedure <porcedure_name>
[(²ÎÊýÃû²ÎÊýÀàÐÍÒÔ¼°ÃèÊö,....)] ---×¢Òâ,ûÓзµ»ØÖµ
is
[±äÁ¿ÉùÃ÷]
begin
[¹ý³Ì´¦Àí];----------null;
exception
when Òì³£Ãû then
end;
×¢Òâ:²ÎÊýÖÐĬÈÏÊÇ°´Öµ´«µÝ.ÊÇin·½Ê½.Ò²¿ÉÒÔÊÇoutºÍin out·½Ê½.ÕâЩÌصãºÍº¯ÊýÒ»Ñù.
B:¾ÙÀý1:
create or replace procedure myPro----create or replace proc myPro ³ö´í ²»Äܼòд
(a in int:=0,b in int:=0)
is
c int:=0;
begin
c:=a+b;
dbms_output.put_line('C is value'||c);
end;
Ö´ÐÐ:
execute myPro(10,20); ---ÔÚSql ServerÖÐ.Ö´Ðд洢¹ý³ÌÊDz»ÐèÒªÀ¨»¡µÄ.×¢Ò⠷ֺŲ»Òªµ÷ÁË.
exec myPro(10,20); --¿ÉÒÔ¼òд
C:¾ÙÀý2:
Èç¹ûÔÚÒ»¸öº¯ÊýÀïÃæ°üº¬SelectÓï¾äµÄ»°,ÄÇô¸ÃSelectÓï¾ä±ØÐëÓÐinto,¹ý³ÌͬÑùÒ²ÐèÒª.
create or replace procedure myPro1
(a int:=0,b int:=0)
is
c int:=0;
begin
select empno+a+b into c from emp where ename='FORD';
dbms_output.put_line('C is values '||c);
end;
Ö´ÐÐ:
execute myPro1(10,20)
D:¼ÙÈçÔÚÒ»¸ö¹ý³ÌÀïÃæÒª·µ»ØÒ»¸ö½á¹û¼¯£¬Ôõô°ì?´ó¼Ò×¢Òâ.¾Í±ØÐëÒªÓõ½ÓαêÁË!ÓÃÓαêÀ´´¦ÀíÕâ¸ö½á¹û¼¯.
create or replace procedure Test
(
varEmpName emp.ename%type
)
is begin ------»á±¨´í.´íÎóÔ­ÒòûÓÐinto×Ó¾ä.
select * from emp where ename like '%'||varEmpName||'%';
end;
Õâ¸ö³ÌÐòÎÒÃÇÎÞ·¨ÓÃinto£¬ÒòΪÔÚOracleÀïÃæûÓÐÒ»¸öÀàÐÍÈ¥½ÓÊÜÒ»¸ö½á¹û¼¯.Õâ¸öʱºòÎÒÃÇ¿ÉÒÔÉùÃ÷Óαê¶ÔÏóÈ¥½ÓÊÜËû.
PL/SQLÓαê:
A:·ÖÀà:
1:ÒþʽÓαê:·ÇÓû§Ã÷È·ÉùÃ÷¶ø²úÉúµÄÓαê. Äã¸ù±¾¿´²»µ½cursorÕâ¸ö¹Ø¼ü×Ö.
2:ÏÔʾÓαê:Óû§Ã÷ȷͨ¹ýcursor¹Ø¼ü×ÖÀ´ÉùÃ÷µÄÓαê.
B:ʲôÊÇÒþʽÓαê:
1:ʲôʱºò²úÉú:
»áÔÚÖ´ÐÐÈκκϷ¨µÄSQLÓï¾ä(DML---INSERT UPDATE DELETE DQL-----SELECT)ÖвúÉú.Ëû²»Ò»¶¨´æ·ÅÊý¾Ý.Ò²ÓпÉÄÜ´æ·Å¼Ç¼¼¯ËùÓ°ÏìµÄÐÐÊý.
Èç¹ûÖ´ÐÐSELECTÓï¾ä,Õâ¸öʱºòÓαê»á´æ·ÅÊý¾Ý.Èç¹ûÖ´ÐÐINSERT UPDATE DELETE»á´æ


Ïà¹ØÎĵµ£º

oracleѹÁ¦²âÊÔÖ®orabm

Êý¾Ý¿âѹÁ¦²âÊÔ
Ò»¡¢ÓÃorabm²âÊÔÊý¾Ý¿âCPU
Orabmͨ¹ýÔÚÓû§Ö¸¶¨µÄ²¢·¢ÏÂÔËÐÐÖ¸¶¨ÊýÁ¿µÄÊÂÎñÀ´²âÊÔϵͳÐÔÄÜ.ËüÖ÷Òª²âÊÔÊý¾Ý¿â·þÎñÆ÷µÄCPUÐÔÄܺÍÄÚ´æ¡£
orabmʵ¼ÊÉÏÊÇÒ»¶ÑsqlµÄ¼¯ºÏ¡£
orabm¿ÉÒÔÓÃÔÚlinux/windows/solarisÏÂʹÓá£
orabm²»Ò»¶¨ÐèÒªÔËÐÐÔÚÊý¾Ý¿âËùÔÚ·þÎñÆ÷ÉÏ£¬Ëü¿ÉÒÔÔËÐÐÔÚÈκΰ²×°ÁË9i¿Í»§¶ËµÄÖÕ¶ËÉÏ¡£Äã ......

OracleÖнØÈ¡×Ö·û´®

¹ØÓÚOracleÀïÃæµÄһЩСº¯Êý
ÒªÇó£ºA.Êý¾Ý¿â±íÖеÄÒ»¸ö×Ö·û´®  ¿ÉÄܺ¬ÓÐ"+" Àý£ºORC+001
       Ò²¿ÉÄܲ»º¬“+”
      B.ÒªÇóÈç¹û¸Ã×Ö·û´®º¬ÓГ+”£¬ÔòÈ¡“+”֮ǰµÄ×Ö·û Àý£ºORC+001 È¡ORC
     ......

¸ü¸ÄOracleÊý¾Ý¿â±íµÄ±í¿Õ¼ä

ÔÚOracleÊý¾Ý¿â¹ÜÀíϵͳÖУ¬´´½¨¿â±í£¨table£©Ê±Òª·ÖÅäÒ»¸ö±í¿Õ¼ä£¨tablespace£©£¬Èç¹ûδָ¶¨±í¿Õ¼ä£¬ÔòʹÓÃϵͳÓû§È·Ê¡µÄ±í¿Õ¼ä¡£
ÔÚOracleʵ¼ÊÓ¦ÓÃÖУ¬ÎÒÃÇ¿ÉÄÜ»áÓöµ½ÕâÑùµÄÎÊÌâ¡£´¦ÓÚÐÔÄÜ»òÕßÆäËû·½ÃæµÄ¿¼ÂÇ£¬ÐèÒª¸Ä±äij¸ö±í»òÕßÊÇij¸öÓû§µÄËùÓбíµÄ±í¿Õ¼ä¡£Í¨³£µÄ×ö·¨¾ÍÊÇÊ×ÏȽ«±íɾ³ý£¬È»ºóÖØн¨±í£¬ÔÚн¨±íʱ½«± ......

¹ØÓÚ·Ö×éºó×Ö¶ÎÆ´½ÓµÄÎÊÌâ (Oracle)

£­£­£­£­£­¹ØÓÚ·Ö×éºó×Ö¶ÎÆ´½ÓµÄÎÊÌâ
À´×Ô:www.itpub.net 
×î½üÔÚÂÛ̳ÉÏ£¬¾­³£»á¿´µ½¹ØÓÚ·Ö×éºó×Ö¶ÎÆ´½ÓµÄÎÊÌ⣬
´ó¸ÅÊÇÀàËÆÏÂÁеÄÇéÐΣº
SQL> select no,q from test
2 /
NO Q
---------- ------------------------------
001 n1
001 n2
001 n3
001 n4
001 n5
002 m1
003 t1
003 t2
003 t3
003 ......

Oracle Òƶ¯Êý¾Ý¿âÎļþ


Oracle
Òƶ¯Êý¾Ý¿âÎļþ

OracleÊý¾Ý¿âÓÉÊý¾ÝÎļþ£¬¿ØÖÆÎļþºÍÁª»úÈÕÖ¾Îļþ
ÈýÖÖÎļþ×é³É¡£
ÓÉÓÚ´ÅÅÌ¿Õ¼äµÄ±ä»¯£¬»òÕß»ùÓÚÊý¾Ý¿â´ÅÅÌI/OÐÔÄܵĵ÷ÕûµÈ£¬ÎÒ們¿ÉÄܻῼÂÇÒƶ¯Êý¾Ý¿âÎļþ¡££¨×¢:
»Ö¸´Êý¾Ý¿âʱ·Ç³£
ÓÐÓã¬ÊôÓÚÀ䱸·Ý£©
²éѯµ±Ç°Êý¾Ý¿âÖÐ,Ïà¹ØÎļþ·¾¶

select * from v$datafile;
se ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ