|
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> set serveroutput on
SQL> declare
2 type type_names is table of varchar2(20);
3 t_names_parent type_names := type_names();
4 t_names_children type_names := type_names();
5 t_names_family type_names := type_names();
6 begin
7 t_names_family.extend(5);
8 t_names_family(1) := 'my father';
9 t_names_family(2) := 'my mother';
10 t_names_family(3) := 'my sister';
11 t_names_family(4) := 'my brother';
12 t_names_family(5) := 'yuechaotian';
13 t_names_children.extend;
14 t_names_children(1) := 'my sister';
15 t_names_children.extend;
16 t_names_children(2) := 'my brother';
17 t_names_children.extend;
18 t_names_children(3) := 'yuechaotian';
19 t_names_parent := t_names_family multiset except t_names_children;
20 for n_pointer in t_names_parent.first..t_names_parent.last loop
21 dbms_output.put_line( t_names_parent(n_pointer) );
22 end loop;
23 end;
24 /
my father
my mother
PL/SQL 过程已成功完成。
SQL> |