f***e 发帖数: 17 | 1 现在我有type point and type line, table polygons(多边形)如下:
create or replace type Point as object(
X float,
Y float
);
/
create or replace type Line as object(
SP point, -- start point
EP point -- end point
);
/
create or replace type LineTableType as
table of Line;
/
create table Polygons(
PID integer,
Lines LineTableType
)
nested table Lines store as LinesTable;
ÏÖÔÚ因为所有µÄµã¶¼&
Ocirc;ÚµÚ1象限£ | n********a 发帖数: 68 | 2 Check constraint can only be enforced on a table.
And you can define constraints on the leaf-level scalar attributes of a column
object.
However, in your case, Polygons.Lines is a table collection of objects.
I don't think you declare a simple check constraint.
Use trigger to iterate each member of Polygons.Lines and check for error
conditions
create or replace trigger trig_polygons
after insert or update on Polygons
for each row
begin
for i in 1..:new.Lines.count loop
if :new.Lines(i).SP.
【在 f***e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 现在我有type point and type line, table polygons(多边形)如下: : create or replace type Point as object( : X float, : Y float : ); : / : create or replace type Line as object( : SP point, -- start point : EP point -- end point : );
| f***e 发帖数: 17 | 3 thank you so much!
column
【在 n********a 的大作中提到】![](/moin_static193/solenoid/img/up.png) : Check constraint can only be enforced on a table. : And you can define constraints on the leaf-level scalar attributes of a column : object. : However, in your case, Polygons.Lines is a table collection of objects. : I don't think you declare a simple check constraint. : Use trigger to iterate each member of Polygons.Lines and check for error : conditions : create or replace trigger trig_polygons : after insert or update on Polygons : for each row
|
|