| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Table with one row
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
![]() |
![]() |