由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - PL/SQL constraint 求教?
相关主题
disable constraintHow to find primary key
请教constraintsRe: have a simple question. Please help
remove special characterHelp!!! constraint in inputting data
请教:空间数据库排序Help on MS SQL code
新手问个spatial data的问题(sql 2008)学MIS 还是统计?
谁知道下面这段是什么意思(ABOUT CONSTRAINTS)what's wrong with this table sql syntax?
another question--怎么delete a row from a tablea oracle question
No Need for trigger Re: oracle trigger questioncan't disable a constraint
相关话题的讨论汇总
话题: point话题: polygons话题: table话题: uacute话题: create
进入Database版参与讨论
1 (共1页)
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 的大作中提到】
: 现在我有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 的大作中提到】
: 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

1 (共1页)
进入Database版参与讨论
相关主题
can't disable a constraint新手问个spatial data的问题(sql 2008)
truncate和delete在ORACLE里有什么区别?谁知道下面这段是什么意思(ABOUT CONSTRAINTS)
how to store a trie into database?another question--怎么delete a row from a table
which sys sp (sql server) show all user sp and functions?No Need for trigger Re: oracle trigger question
disable constraintHow to find primary key
请教constraintsRe: have a simple question. Please help
remove special characterHelp!!! constraint in inputting data
请教:空间数据库排序Help on MS SQL code
相关话题的讨论汇总
话题: point话题: polygons话题: table话题: uacute话题: create