Re: Constraining table to 1 record

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 18 Aug 1999 12:23:40 GMT
Message-ID: <37c2a5a7.177954374_at_newshost.us.oracle.com>


[Quoted] 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....

-- 
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Wed Aug 18 1999 - 14:23:40 CEST

Original text of this message