±±´óÇàÄñoracleѧϰ±Ê¼Ç13
ǶÌ×±í£º
Óë¿É±äÊý×éÀàËÆ£¬²»Í¬Ö®´¦ÊÇǶÌ×±íûÓÐÊý¾ÝÉÏÏÞ¡£
Óï·¨£º
´´½¨»ùÀàÐÍ
create or replace type ǶÌ×±í»ùÀàÐÍÃû as object(×ֶβÎÊý);
create or replace type mingxitype as object(
goodsid varchar(15),
incount int,
providerid varchar(10)
)not final;
´´½¨Ç¶Ì×±íÀàÐÍ
create or replace type ǶÌ×±íÀàÐÍÃû as table of ÀàÐÍÃû;
create or replace type nestmingxitype as table of mingxitype;
´´½¨±í
create table Ö÷±íÃû(
×Ö¶Î1 ÀàÐÍ,
×Ö¶Î2 ÀàÐÍ,
...
×Ö¶În ÀàÐÍ,
ǶÌ×ÀàÐÍ×ֶΠǶÌ×±íÀàÐÍÃû
)nested table ǶÌ×ÀàÐÍ×Ö¶ÎÃû store as ÕæÕý´æ´¢µÄǶÌ×±í;
create table instock
(
orderid varchar(13) not null primary key,
indate date,
mingxi nestmingxitype
)nested table mingxi store as mingxitable;
ÕâÀïÎÒÏë·ÃÎÊʵ¼Ê´æ´¢µÄ±ímingxitable£¬½á¹ûoracle±¨´íÈçÏ£º
cannot reference nested table column's storage table
¿´À´Ïë¿´¿´ÊDz»ÐÐÁË
Ìí¼ÓÊý¾Ý£º
insert into Ö÷±íÃû [(×Ö¶ÎÁбí)] values(
»ù±¾²ÎÊýÁбí,
ǶÌ×±íÀàÐÍÃû(ǶÌ×±í»ùÀàÐÍÃû(²ÎÊýÁбí))
);
insert into instock values(
'200200060001',
to_date('2002-08-06','yyyy-mm-dd'),
nestmingxitype(
mingxitype('j001',200,'1001'),
mingxitype('s001',1000,'1002'),
mingxitype('t005',500,'1003')
)
);
¸üÐÂǶÌ×±íÊý¾Ý£º
¸üÐÂǶÌ×±íʱ²¢²»ÓÃÏñ¸üпɱäÊý×éÒ»Ñù¸üÐÂÈ«²¿Êý¾Ý£¬¿ÉÒÔ¸üÐÂÖÆ¶¨Êý¾Ý¡£
update table(select t.mingxi from instock t where orderid = 1002) mx
set mx.incount = 500
where mx.goodid='10001';
²éѯǶÌ×±íÖÐÊý¾Ý£º
select * from table(select p.mingxi from instock where orderid = '200200060001');
ɾ³ýǶÌ×±íÊý¾Ý£º
delete from table(select t.mingxi from instock t where orderid = '200200060001') t
where t.goodsid='j0001';
×ÜÖ®£¬Ê¹ÓÃtable()º¯Êý½«Ç¶Ì×±í¿´×÷Ò»ÕÅÆÕͨµÄ±í£¬²Ù×÷ʱºò½«º¯ÊýǶÌ×µ½sqlÓï¾äÖм´¿É¡£
¶ÔÏó±í£º
±íÖÐÿһÐж¼´ú±íÒ»¸ö¶ÔÏó
°üº¬¶ÔÏó±êʶ·û OID
REF²Ù×÷·ûÓÃÓÚÒýÓÃÐжÔÏó
DEREF²Ù×÷·ûÓû§·µ»ØÐжÔÏóµÄÖµ
Àý£º
´´½¨¿ÆÊÒÀàÐÍ
create or replace type officetype as object(
id varchar(10),
typename varchar(10)
);
ͨ¹ý¿ÆÊÒÀàÐÍ´´½¨¿ÆÊÒ±í
create table offic of officetype;
²
Ïà¹ØÎĵµ£º
±í·ÖÇøÎ¬»¤£º
Ìí¼Ó·ÖÇø£º
Alter table student add partition ·ÖÇøÃû values less than(100);
ɾ³ý·ÖÇø£º
Alter table student drop partition ·ÖÇøÃû;
½Ø¶Ì·ÖÇø£º
Alter table student truncate partition ·ÖÇøÃû;
ºÏ²¢·ÖÇø£º
Alter table student merge partitions ·ÖÇøÃû,...,·ÖÇøÃû into partition зÖÇøÃû; ......
¡í1:È¡µÃµ±Ç°ÈÕÆÚÊDZ¾Ôµĵڼ¸ÖÜ
SQL> select to_char(sysdate,'YYYYMMDD W HH24:MI:SS') from
dual;
TO_CHAR(SYSDATE,'YY
-------------------
20030327 4 18:16:09
SQL> select to_char(sysdate,'W') from dual;
T
-
4 ......
´Ø£º
Óй«¹²ÁеÄÁ½¸ö»ò¶à¸ö±íµÄ¼¯ºÏ
´Ø±íÖеÄÊý¾Ý´æ´¢ÔÚ¹«¹²Êý¾Ý¿éÖÐ
´Ø¼ü£º
Ψһ±êʶ·û
´´½¨´Ø£º
¼õÉÙI/O²Ù×÷£¬¼õÉÙ´ÅÅ̿ռ䣬µ«ÊDzåÈëÐÔÄܽµµÍ¡£
Á½ÕűíÖÐÓй²Í¬µÄÁУ¬±ÈÈçѧÉú±íÖÐÓа༶±àºÅ£¬°à¼¶±íÖÐÒ²Óа༶±àºÅ£¬¿ÉÒÔ½«°à¼¶±àºÅ´æ·ÅÔÚ´ØÖÐ
create cluster ´ØÃû(
×Ö¶ÎÃû ÀàÐÍ
)tablespace ±íÃüÃû¿Õ¼ä;
cr ......
¹ØÏµÐÍÊý¾Ý¿âÀíÂÛÖÐ×Ö¶ÎÖµ±ØÐëÊǵ¥Öµ£¬¶øoracleÖÐÔÊÐíÔÚÒ»¸ö×Ö¶ÎÖд洢һ¸ö±íµÄÄÚÈÝ¡£
È磺Ա¹¤±íÖеÄÍâ¼ü ²¿ÃűàºÅ£¬oracleÖÐÕâ¸ö×ֶοÉÒÔ´æ·Å²¿ÃŵļǼ¶ø²¢²»ÊÇÒ»¸öÍâ¼ü£¬ÕâÑù²éѯʱºòµÄЧÂÊ»áÌá¸ß¡£
¿É±äÊý×飺
´´½¨´øÓпɱäÊý×éµÄ±í
´´½¨¿É±äÊý×é»ùÀàÐÍ
create or replace type »ùÀàÐÍÃû as object(×Ö¶ÎÇåµ¥);
......
TNS-12518: TNS:listener could not hand off client connection
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error
32-bit Windows Error: 2: No such file or directory
½â¾ö·½·¨£º
ÒòΪÎÒʹÓõÄÊÇÐéÄâ»ú£¬ËùÒÔÔÚIPÉÏĬÈϵÄ×Ô¶¯· ......