Re: Constraining table to 1 record

From: Kenneth C Stahl <BluesSax_at_Unforgettable.com>
Date: Wed, 18 Aug 1999 10:48:47 -0400
Message-ID: <37BAC7CF.CFD66D13_at_Unforgettable.com>


Thomas Kyte wrote:

> A copy of this was sent to Brian Howard <bh_at_creditwatch-inc.com>
> (if that email address didn't require changing)
> On Tue, 17 Aug 1999 18:41:29 GMT, you wrote:
>
> >What is the easiest way to constrain a table to 1 record only. I have a
> >table that needs only a single entry. I am using Designer 2.1.2 and
> >Developer Forms 5.
>
> SQL> create table t ( x int primary key check ( x = 1 ) );
>
> Table created.
>
> SQL>
> SQL> insert into t values ( 1 );
>
> will do it. make a column be a primary key and put a check constraint on that
> column that allows it to have but 1 value....

Now that is tricky! And very elegant as well! Received on Wed Aug 18 1999 - 16:48:47 CEST

Original text of this message