Re: A Logical Model for Lists as Relations

From: vc <boston103_at_hotmail.com>
Date: 10 May 2006 08:25:50 -0700
Message-ID: <1147274750.553002.225280_at_j73g2000cwa.googlegroups.com>


David Cressey wrote:
> "Marshall Spight" <marshall.spight_at_gmail.com> wrote in message
> news:1147218113.519014.27620_at_e56g2000cwe.googlegroups.com...
> > I am interested in the question of how best to handle lists in a
> > relation-oriented world. I have considered various approaches,
> > usually oriented around adding a list collection type.
> >
>
> This reply is way off topic, and I apologize if it's a distraction.
>
> Oracle makes a distinction between a select that produces a result set, and
> a select that produces something else,

It does not.

>something that might well be called a
> list. (I forget what Oracle documentation calls it).
>
> The distinction is based on the presence or absence of the "ordered by
> clause". A SELECT ... ORDERED BY gives a list, while the other kind gives a
> set.

The 'ORDER BY' clause produces an ordered set that one can considered a list .

>
> This shows up in an odd way: you can't put an "ORDERED BY" in the select
> that implements a view. If you do, you'll get an error message.

No, you won't because a view is nothing but a stored query:

SQL> create table t1(x int);

Table created.

SQL> insert into t1 values(5);

1 row created.

SQL> insert into t1 values(1);

1 row created.

SQL> insert into t1 values(3);

1 row created.

SQL> create view v1 as select x from t1 order by x

View created.

SQL> select x from v1;

         X


         1
         3
         5

SQL>
>
> Other SQL DBMS products, like DEC Rdb, have no such restriction on views.
> You can have a view with an ORDERED BY. You can use such a view in a
> context where a set would be expected. When I do that, I get the result I
> would have expected.
>
> This seemed so intuitive to me that I scarcely realized the issue until I
> moved to a product that forbids it.
Received on Wed May 10 2006 - 17:25:50 CEST

Original text of this message