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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Are one row, one column tables "acceptable"?

Re: Are one row, one column tables "acceptable"?

From: Thomas T <T_at_T>
Date: Tue, 8 Apr 2003 17:33:53 -0400
Message-ID: <3e934041$1@rutgers.edu>


"Ed Prochak" <edprochak_at_adelphia.net> wrote in message news:3E90E786.2060503_at_adelphia.net...
> Niall Litchfield wrote:
> > "Hans Forbrich" <forbrich_at_telusplanet.net> wrote in message
> > news:3E8FCE58.DA81CCE1_at_telusplanet.net...
> >
> >>Thomas T wrote:
> >>
> >>
> >>>How acceptable are one row, one column tables? I've heard of people
> >>
> > storing
> >
> >>>multiple system variables in two-column, multi-row tables, with column
> >>
> > names
> >
> >>>such as "parameter_name" and "parameter_value". But is using a one
> >>
> > row/one
> >
> >>>column table common? Or is it a way that works, but of bad design
(like
> >>>creating multiple public rollback segments in the System tablespace)?
> >>
> >>A 1-row, 1-column table is not a bad thing. It tends to look silly, and
> >
> > many
> >
> >>purists will argue against it. But, remember the most famous table of
all
> >>"DUAL"!
> >
> >
> > I won't argue against it, it depends on the design. However if bringing
dual
> > into the conversation be aware of the following (in a play area not a
> > production system that wuld be silly)
> >
> > sqlplus /nolog
> > shutdown
> > startup nomount
> > select * from dual;
> >
> >

>
> And some how some day, someone will insert something into your one row
table.
> then your system fails because your PL/SQL has lines like:

>

> SELECT myvalue INTO mypackagevar from my1rowtable;
>

> which throws an exception for multiple rows returned.
>

> (Yes this can even happen with DUAL!)
>

> So I vote to avoid this kind of table.
>

> --
> Ed Prochak
> running: http://www.faqs.org/faqs/running-faq/
> family: http://web.magicinterface.com/~collins
> --
> "Two roads diverged in a wood and I
> I took the one less travelled by
> and that has made all the difference."
> robert frost

>

Ed, I figured that I would make this table inaccessible to the regular DB users, via the grant/revoke select statements. But, good point; it's not good to allow any possibility for a crash!

Thanks!

-Thomas Received on Tue Apr 08 2003 - 16:33:53 CDT

Original text of this message

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