Re: [GENERAL] How to write a constraint which need to check other table?

2009-09-28 Thread 纪晓曦
Thank you very much, I think I need to stady more about trigger. 2009/9/28 A. Kretschmer > In response to ? : > > Yes, you are right. That maybe a bad example. what I want to say maybe > like > > this: > > > > create table a ( > > id integer, > > room varchar(32), > >

Re: [GENERAL] How to write a constraint which need to check other table?

2009-09-28 Thread A. Kretschmer
In response to ? : > Yes, you are right. That maybe a bad example. what I want to say maybe like > this: > > create table a ( > id integer, > room varchar(32), > start time, > end time, > PRIMARY KEY(id) > ) > How can I check if it is the same r

Re: [GENERAL] How to write a constraint which need to check other table?

2009-09-28 Thread A. Kretschmer
In response to ? : > create table a( > name varchar(32); > ); > > create talbe b( >   name1 varchar(32); >   name2 varchar(32); > ); > > > How to write a constraint to check name1, name2 in the table a without change > table defination? -- Okay, your tables with

[GENERAL] How to write a constraint which need to check other table?

2009-09-28 Thread 纪晓曦
create table a( name varchar(32); ); create talbe b( name1 varchar(32); name2 varchar(32); ); How to write a constraint to check name1, name2 in the table a without change table defination? ALTER TABLE b ADD CHECK( ??? );