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

±±´óÇàÄñoracleѧϰ±Ê¼Ç12


¹ØϵÐÍÊý¾Ý¿âÀíÂÛÖÐ×Ö¶ÎÖµ±ØÐëÊǵ¥Öµ£¬¶øoracleÖÐÔÊÐíÔÚÒ»¸ö×Ö¶ÎÖд洢һ¸ö±íµÄÄÚÈÝ¡£
È磺Ա¹¤±íÖеÄÍâ¼ü ²¿ÃűàºÅ£¬oracleÖÐÕâ¸ö×ֶοÉÒÔ´æ·Å²¿ÃŵļǼ¶ø²¢²»ÊÇÒ»¸öÍâ¼ü£¬ÕâÑù²éѯʱºòµÄЧÂÊ»áÌá¸ß¡£
¿É±äÊý×飺
´´½¨´øÓпɱäÊý×éµÄ±í
´´½¨¿É±äÊý×é»ùÀàÐÍ
create or replace type »ùÀàÐÍÃû as object(×Ö¶ÎÇåµ¥);
´´½¨¿É±äÊý×éÀàÐÍ
create or replace ¿É±äÊý×éÀàÐÍÃû as varray(×î´óÐÐÊý) of ¿É±äÊý×éµÄ»ùÀàÐÍ;
ʵÀý£º
create or replace type mingxitype as object
(
goodsid varchar(15),
incount int,
providerid varchar(10)
);
create or replace type arrmingxitype as varray(100) of mingxitype;
´´½¨Ò»¸öÖ÷±í
create table instock
(
orderid int primary key,
indate date,
mingxi arrmingxitype
);
ÀûÓù¹Ô캯Êý²åÈëÊý¾Ý
insert into instock values(
'200208070001',
to_date('2002-08-07','yyyy-mm-dd'),
arrmingxitype(
mingxitype('101',10,'S01'),
mingxitype('102',20,'S02')
)
);
²éѯ
select * from instock;ÔòÏÔʾ¶ÔÏó¶ø²¢²»ÊÇÏñ¹ØϵÊý¾Ý¿âÄÇÑùµÄ±íµ¥
select * from table(
select s.mingxi from instock s where orderid = 1001
);
´ËʱÏÔʾµÄÊǿɱäÊý×éÖеÄÐÅÏ¢¶øûÓÐÖ÷±íÖеÄÐÅÏ¢¡£
tableº¯ÊýÒªÇóÄÚ²¿×Ó²éѯ±ØÐëÃ÷È·È·¶¨Ò»Ìõ¼Ç¼£¡
Ð޸ĿɱäÊý×é±È½ÏÂé·³£¬±ØÐëÐÞ¸ÄÕû¸öÊý×éµÄ¼Ç¼¡£ËùÒԿɱäÊý×鳣ʹÓÃÔÚ»ù±¾²»ÐèÒªÐ޸ĵļǼ£¨ÈçÀúÊ·¼Ç¼µÈ£©
update instock set mingxi = arrmingxitype(
mingxitype('101',20,'S01'),
mingxitype('102',30,'S02')
)where orderid = '200208070001';
ɾ³ý¼Ç¼²Ù×÷Óë¹ØϵÐÍÊý¾Ý¿âÒ»Ö£¬É¾³ýÕûÌõÖ÷¼Ç¼¡£
delete from instock where orderid = '1001';


Ïà¹ØÎĵµ£º

±±´óÇàÄñoracleѧϰ±Ê¼Ç1¡«2

    ÕâѧÆÚ×¼±¸»¨ÉÙÐíʱ¼äÑо¿Ò»ÏÂoracle£¬Ì¨Ê½»úµÄUbuntu²»Îȶ¨ÀÏ»µ£¬·ÅÆúÁËlinuxÉÏʹÓÃoracleµÄÏë·¨£¬ÔÚ×Ô¼º±Ê¼Ç±¾ÉÏ×°ÁËÒ»¸öoracle 10g express°æ±¾£¬Ñ§Ï°Ò»Ï¡£
    ±¾À´»¹ÏëÓÃÔƶËÐéÄ⻯һÏÂoracle£¬ÊµÑéʧ°Ü£¬ÀÏÀÏʵʵÈÃoracleÇÖÈëÎÒµÄϵͳ¡£¡£¡£囧
    °²×°Íê ......

oracle ѧϰ±Ê¼Ç

start d:\a.sql
@    d:\a.sql
edit [d:\a.sql]
spool d:\a.sql ½«ÆÁÉÏÄÚÈÝ Êä³öµ½Ö¸¶¨Îļþ
spool off
set linesize 320
set pagesize 100
set autoprint on
set serveroutput on
variable v1 refcursor 
exp imp ±¸·Ý »Ö
Ö»¶ÁÊÂÎñ
 set transaction read only
 Óô¦£¬ÉèÖà ......

±±´óÇàÄñoracleѧϰ±Ê¼Ç4 5

sql plus ±£´æsqlÓï¾ä
save 'd:\sql.txt';½«oracle»º´æÇøÖеÄsqlÓï¾ä´æÈëÎļþ¡£
get 'd:\sql.txt';´ËʱsqlÓï¾ä±»¼ÓÔص½oracle»º´æÇø£¬Ê¹ÓÃrun;ÃüÁîÖ´ÐÐsqlÓï¾ä¡£
@'d:\sql.txt';¼ÓÔØsqlÓï¾ä²¢Ö±½ÓÖ´ÐС£
oracleÖеĺ¯Êý
 
1. ת»»º¯Êý
TO_CHAR(number[,format])
½«Ò»¸öÊýֵת»»³ÉÓëÖ®µÈ¼ÛµÄ×Ö·û´®.Èç¹û²»Ö¸ ......

±±´óÇàÄñoracleѧϰ±Ê¼Ç6

Ëø
²éѯÆäËûÓû§µÄ±í <Óû§Ãû.±íÃû>
Ëø¶¨Ä£Ê½£º
Ðм¶Ëø
Ðб»ÅÅËûÐÔËø¶¨
ÔÚijÐеÄËø±»ÊÍ·Å֮ǰ£¬ÆäËûÓû§²»ÄÜÐ޸ĴËÐÐ
ʹÓÃcommit rollbackÃüÁîÊÍ·ÅËø
»ñÈ¡Ðм¶Ëø
ʹÓÃinsert¡¢updateÓï¾ä£¬×Ô¶¯ÉÏÐм¶Ëø
ʹÓÃselect...for update [of ÁÐÃû] Óï¾ä×Ô¶¯»ñÈ¡Ðм¶Ëø
ÔÚ±íµÄÒ»Ðлò¶àÐзÅÖÃÅÅËûËø£¬ÓÃÓÚ·ÀÖÎÆäË ......

½ñÌìoracle DBA½ç´óʦ¼¶ÈËÎï¸Ç¹úÇ¿ÏÈÉúÀ´ÎÒÃǹ«Ë¾

      2010Äê3ÔÂ5ÈÕ£¬ËäÈ»º®·ç´Ì¹Ç£¬µ«ÒÀÈ»µ²²»×¡¹«Ë¾Í¬ÊºÍÎÒ¹¤×÷µÄÈÈÇé.µÎ´ð¡¢µÎ´ð,ͬÊÂÊÖ»úÏìÁË£¬ÀÏ×ܸøËû´òµç»°£¬Ëµ¹ã¶«ÁªÍ¨ÍøÓÅƽ̨Êý¾Ý¿â³öÏÖÎÊÌ⣬ÓÉÓÚÊý¾ÝÁ¿È·Êµ¹ý´ó£¬Í¬ÊÂÒÔÇ°Ò²´¦Àí¹ýÄDZߵÄÎÊÌ⣬Ö÷ÒªÊÇËùÓÐÊý¾ÝÁ¿´óµÄ±íÿ¸ôÒ»Ì콨Á¢Ò»¸öË÷Òý£¬ÕâÑù²éѯÊý¾ÝËٶȱȽϿ졣µ«ÊǽøÐÐÊý¾Ý»ã× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ