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

oracle ´æ´¢¹ý³ÌʵÀý


/*²»´øÈκβÎÊý´æ´¢¹ý³Ì(Êä³öϵͳÈÕÆÚ)*/
create or replace procedure output_date is
begin
dbms_output.put_line(sysdate);
end output_date;
/*´ø²ÎÊýinºÍoutµÄ´æ´¢¹ý³Ì*/
create or replace procedure get_username(v_id in number,v_username out varchar2)
as
begin
  select username into v_username from tab_user where id = v_id; --±äÁ¿¸³Öµ
exception
when no_data_found then
raise_application_error(-20001,'ID²»´æÔÚ!');
end get_username;


Ïà¹ØÎĵµ£º

Oracle±í¿Õ¼ä¹ÜÀí

extent--×îС¿Õ¼ä·ÖÅ䵥λ --tablespace management
block --×îСi/oµ¥Î»      --segment    management
create tablespace james
datafile '/export/home/oracle/oradata/james.dbf'
size 100M ¡¡¡¡¡¡¡¡¡¡¡¡--³õʼµÄÎļþ´óС¡¡
autoextend On¡¡¡¡¡¡¡¡ --×Ô¶¯Ôö³¤
next 10M¡ ......

Oracle ±íÁ¬½Ó·½Ê½½éÉÜ£¨SML + NL + HJ£©

JoinÊÇÒ»ÖÖÊÔͼ½«Á½¸ö±í½áºÏÔÚÒ»ÆðµÄν´Ê£¬Ò»´ÎÖ»ÄÜÁ¬½Ó2¸ö±í£¬±íÁ¬½ÓÒ²¿ÉÒÔ±»³ÆΪ±í¹ØÁª¡£ÔÚºóÃæµÄÐðÊöÖУ¬ÎÒÃǽ«»áʹÓÔrow source”À´´úÌ攱픣¬ÒòΪʹÓÃrow source¸üÑϽ÷һЩ£¬²¢ÇÒ½«²ÎÓëÁ¬½ÓµÄ2¸örow source·Ö±ð³ÆΪrow source1ºÍrow source 2¡£Join¹ý³ÌµÄ¸÷¸ö²½Öè¾­³£ÊÇ´®ÐвÙ×÷£¬¼´Ê¹Ïà¹ØµÄr ......

ORACLE ÓαêµÄʹÓÃ

declare cursor myCursor is select * from ±íÃû;
myRow myCursor%rowtype;
begin
open myCursor;
loop
fetch myCursor into myRow;
exit when myCursor%notfound;
--ÒªÖ´ÐеÄSQLÓï¾ä
end loop;
end; ......

Oracle·ÖÒ³²éѯÓï¾ä


·ÖÒ³²éѯ¸ñʽ£º
SELECT * from 
(
SELECT A.*, ROWNUM RN 
from (SELECT * from TABLE_NAME) A 
WHERE ROWNUM <= 40
)
WHERE RN >= 21
ÆäÖÐ×îÄÚ²ãµÄ²éѯSELECT * from TABLE_NAME±íʾ²»½øÐз­Ò³µÄԭʼ²éѯÓï¾ä¡£ROWNUM <= 40ºÍRN >= 21¿ØÖÆ·ÖÒ³²éѯµÄÿҳµÄ·¶Î§¡£
ÉÏÃæ¸ø³öµÄÕâ¸ö·ÖÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ