Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: limit TABLE to only one record

Re: limit TABLE to only one record

From: <sybrandb_at_hccnet.nl>
Date: Wed, 14 Nov 2007 21:39:30 +0100
Message-ID: <c6nmj3h3tnpj9og6jrt8s64ogotfm6ciml@4ax.com>


On Wed, 14 Nov 2007 13:55:54 -0500, Brian Tkatch <N/A> wrote:

>I am looking to store an easily modifiable value that a VIEW can use,
>without issuing any DDL statements. I'm guessing that a TABLE with one
>record would be a good way. The question then is how to limit a TABLE
>to only one record:
>
>CREATE TABLE One_Record_Only
>(
> Id INT DEFAULT 1,
> Data INT,
> CONSTRAINT ORO1_Id_NN CHECK(Id IS NOT NULL),
> CONSTRAINT ORO1_Id_CK CHECK(Id = 1),
> CONSTRAINT ORO1_Id_PK PRIMARY KEY(Id)
> USING INDEX (CREATE UNIQUE INDEX ORO1_Id_PK ON One_Record_Only(Id))
>);
>
> Is there a more straightforward emthod to limit a TABLE to only one
>record?
>
> Is there another way to accomplish the same goal?
>
>B.

A more straightforward method would be using the correct constraint syntax.

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Wed Nov 14 2007 - 14:39:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US