oracleÁ·Ï°£¨mldnÊÓƵ¿Î³Ì£©Îå
£¨´ËƪÎÄÕÂÖ»ÐèÒªÁ˽â¼È¿ÉÒÔÁË£©
ǶÌ×±í
¶¨Ò壺ÔÚÒ»¸ö±íÖл¹°üº¬ÁíÍâÒ»¸ö×Ó±í¡£
Êý¾Ý¿âÔÚ´´½¨Êý¾Ý±íµÄʱºò¶¼ÒªÖ¸¶¨×ֶεÄÀàÐÍ£¬ËùÒÔǶÌ×±í±¾ÉíÒ²ÐèҪͬÑùÖ¸¶¨ÀàÐÍ£¬ËùÒÔÕâÖÖÀàÐÍÐèÒªµ¥¶À¶¨Òå¡£
´´½¨ÀàÐÍÓï·¨£ºcreate type project_ty as object£¨
×Ö¶Î1 Êý¾ÝÀàÐÍ£¬
×Ö¶Î2 Êý¾ÝÀàÐÍ£¬
.....
£©;
/
·¶Àý£ºÒ»¸ö²¿ÃÅ¿ÉÄܳнӶà¸öÏîÄ¿
1£¬ÏÈ´´½¨ÀàÐÍ
create type project_ty as object£¨
proid number(4),
proname varchar2(50)£¬
prodate date
£©;
/
2£¬ÀàÐÍ´´½¨³É¹¦£¬ÐèҪΪÀàÐÍÖ¸¶¨Ãû³Æ
create type project_nt as table of project_ty;Ãû³ÆΪproject_nt
3£¬´´½¨²¿ÃÅǶÌ×±í
create table department(
deptno number(2) primary key not null,
dname varchar2(50) not null,
projects project_nt
) nested table projects store project_nt_tab_temp;
4£¬²åÈëÊý¾Ý
insert into department(deptno,dname,projects)
values(1,'¼¼Êõ²¿',
project_nt(
project_t
Ïà¹ØÎĵµ£º
1. ²é¿´Êý¾ÝµÄ×Ö·û¼¯
sqlplus> col parameter format a30
sqlplus> col value format a30
sqlplus> select * from nls_database_parameter
PARAMETER VALUE
------------------------------ --------------------
...
NLS_CH ......
ÊÓͼ
´´½¨ÐÂ±í£ºcreate table emp2 as select * from emp;
create view empv20 as select empno,ename,job,hiredate,deptno from emp where deptno=20 with check option;
Óï·¨£ºcreate or replace view ÊÓͼÃû³Æ as ×Ó²éѯ£¨ÐÞ¸ÄÖ®ºóµÄ×Ó²éѯ£©
Ìæ»»ÊÓͼ(ÐÞ¸Ä)
create or replace view empv20 as select empno,ename, ......
1£© ½¨Á¢ÐòÁÐÃüÁî
CREATE SEQUENCE [user.]sequence_name
[increment by n]
[start with n]
[maxvalue n | nomaxvalue]
[minvalue n | nominvalue];
INCREMENT BY£º Ö¸¶¨ÐòÁкÅÖ®¼äµÄ¼ä¸ô ......
ÒÔϼ¸ÖÖÔ¼Êø ¡¢²¢ Ò»Ò»Áо٣º
1.Ö÷¼üÔ¼Êø£º
Òª¶ÔÒ»¸öÁмÓÖ÷¼üÔ¼ÊøµÄ»°£¬ÕâÁоͱØÐëÒªÂú×ãµÄÌõ¼þ¾ÍÊÇ·Ö¿Õ
ÒòΪÖ÷¼üÔ¼Êø£º¾ÍÊǶÔÒ»¸öÁнøÐÐÁËÔ¼Êø£¬Ô¼ÊøΪ£¨·Ç¿Õ¡¢²»Öظ´£©
ÒÔÏÂÊÇ´úÂë Òª¶ÔÒ»¸öÁмÓÖ÷¼ü£¬ÁÐÃûΪid,±íÃûΪemp
¸ñʽΪ£º
alter table ±í¸ñÃû³Æ add constraint Ô¼ÊøÃû³Æ Ôö¼ÓµÄÔ¼ÊøÀàÐÍ £¨ÁÐÃû£©
À ......