What does it mean to SET a value?

What does it mean to SET a value?

am 01.04.2008 11:59:45 von Rog11228

What does it mean to set a value or April fools all year long :)

http://beyondsql.blogspot.com/2008/03/sql-what-does-it-mean- to-set-value.html

Re: What does it mean to SET a value?

am 03.04.2008 05:16:38 von Ed Murphy

steve wrote:

> What does it mean to set a value or April fools all year long :)
>
> http://beyondsql.blogspot.com/2008/03/sql-what-does-it-mean- to-set-value.html

The relevant portion of this article appears to be the following:

> In Sql when there are multiple rows that satisfy a
> a WHERE clause the variable is left undefined and an error generated:
>
> DECLARE @MyFrt MONEY;
> SET @MyFrt = (SELECT Freight FROM Orders WHERE OrderID<=10249);
> -- Subquery returned more than 1 value. This is not permitted when the subquery follows
> -- =, !=, <, <= , >, >= or when the subquery is used as an expression.
>
> This is really a valid logical operation, an attempt to set (assign) a table to a variable.
> This is precisely what D4 does:
>
> var MyFrt:=Orders where OrderID<=10249 {Freight};
>
> select MyFrt;
>
> Freight //A table.
> -------
> $11.61
> $32.38
>
> select MyFrt is table{Freight:Money};//Returns True confirming MyFrt is a table type.

But why not simply use a temporary table?

select Freight into #MyFrtTable from Orders where OrderID <= 10249

Your previous line of argument (explicit table-valued procedure
parameters, replacing implicit temp-table input/output and/or
SELECT/FROM-based output) was more compelling; my objection to it
was limited to D4 being an utter non-starter for the large number
of existing systems already implemented in SQL. This line of
argument, while understandable in principle, is less of a big deal.

Re: What does it mean to SET a value?

am 04.04.2008 11:32:09 von Rog11228

Hello Ed,

>But why not simply use a temporary table?
>select Freight into #MyFrtTable from Orders where OrderID <= 10249

Though it's apples and oranges I confess I smiled when I saw your
suggestion:)

>This line of argument, while understandable in principle, is less of a big deal.

This is the heart of the matter. A system based on principles versus a
system based on arbitrary choices!:) I'm trying to show the advantages
of a system based on a comprehensive theory. That I have to make the
case for logic says something about the database world:)

Now that dataphor is back in development as an open source project:
http://www.dataphor.org
http://databaseconsultinggroup.com
http://databaseconsultinggroup.com/downloads/
I think you'll see some people build 'new' systems with it. Just where
these people will come from I'm sure. I hope some of them come from
the sql community. What is the problem with just moving on? Was MS
worried about the large number of existing sql systems when they were
developing LINQ? And dataphor represents a very viable alternative to
users considering LINQ :)

You comments are appreciated.

best,
steve
www.beyondsql.blogspot.com