Re: How to do...well...any thing...in DB2 SQL
Ian Boyd wrote:
[color=blue][color=green]
>> As someone
>> else mentioned, in SQL "everything is a table" (a single row is just a
>> special case of a table, and a single value is another such special
>> case).[/color]
>
> Not everything is a table. USER is a special register. There are plenty of
> "special registers".[/color]
When you use USER as an expression in a SQL statement, its value is used.
Where the value originates from is not of interest and the "everything is a
table" also applies to other scalar values, for example constants or values
recieved from an application via host-variables.
A single value (also called scalar value) is the same as a table with one
row and one column. If you try to think that way, statements like
SET (a, b, c) = (1, 2, 3)
are much easier to understand, I'd say.
--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Ian Boyd wrote:
[color=blue][color=green]
>> As someone
>> else mentioned, in SQL "everything is a table" (a single row is just a
>> special case of a table, and a single value is another such special
>> case).[/color]
>
> Not everything is a table. USER is a special register. There are plenty of
> "special registers".[/color]
When you use USER as an expression in a SQL statement, its value is used.
Where the value originates from is not of interest and the "everything is a
table" also applies to other scalar values, for example constants or values
recieved from an application via host-variables.
A single value (also called scalar value) is the same as a table with one
row and one column. If you try to think that way, statements like
SET (a, b, c) = (1, 2, 3)
are much easier to understand, I'd say.
--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Comment