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_at_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 - 19:24:32 CEST

Original text of this message