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

Home -> Community -> Usenet -> comp.databases.theory -> Re: Table with one row

Re: Table with one row

From: Mikito Harakiri <mikharakiri_nospaum_at_yahoo.com>
Date: 19 Oct 2005 10:24:32 -0700
Message-ID: <1129742672.689217.64430@g43g2000cwa.googlegroups.com>


zeldorblat_at_gmail.com wrote:
> My question is twofold. First, how does one restrict the number of
> rows in a table (in this case, to guarantee there's only one row) ? I
> suppose you can use a trigger, but perhaps there's a better way.
>
> Second, to be relationally correct, the table needs a primary key.

Primary key is empty. Does your RDBMS of choice allow primary key with empty set of columns. (I doubt so:-)

Alternatively, you can create incrementally maintained materialised view that counts the records and hang check constraint on it, if your RDBMS supports this feature. Received on Wed Oct 19 2005 - 12:24:32 CDT

Original text of this message

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