From: Brian Tkatch on
>From almost day one, i got burned fetching column values by ordinal. It's
>just a bad idea. Yes i could do it, and i could be forced to keep the
>ordinal location of every field in every table, result set, or query.

Not in the TABLE, in the query. And the query changes per application,
so no problem. If the query is in a stored PROCEDURE, and outputs a
result set, it is best to use the VALUES inside a SELECT statement as
Knut pointed out.

B.

From: Gert van der Kooij on
In article <dupi4p030la(a)enews3.newsguy.com>, Ian Boyd (ian.msnews010
@avatopia.com) says...
> > This isn't right, it depends. If you put multiple commands in one
> > file you need to seperate them if you keep them on one line
>
> Nobody here will write queries on all one line. It's jut a practical thing.
>
> > 'create function' and 'create trigger' statements needs to be
> > seperated by another delimiter.
> > connect to <yourdb> @
>
> i am already connected using ADO. The "connect to <yourdb> @" is invalid
> DB2-SQL.
> If i need to separate statements, i'm going to have to do it manually.
>
>

Which tool are you using to run your SQL?
I guess I'm missing the overall picture, did you post it somewhere in
this thread?
From: Ian Boyd on
> You may not like the IBM diagrams, but they are indeed very clear.

The same diagrams are in the ANSI spec. They are very clear once you already
know the syntax.


From: Ian Boyd on
> And the query changes per application,
> so no problem.

Not when a query is the query was written in one application and used by
another.

> If the query is in a stored PROCEDURE, and outputs a
> result set, it is best to use the VALUES inside a SELECT statement as
> Knut pointed out.

How do you give names to the fields returned from a SELECT of a VALUES
table?


From: Ian Boyd on
> 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

That doesn't solve the inconsistency of sometimes being able to use scalars
and sometimes not, and sometimes being able to use tables and sometimes not.

i'm less pointing out the "what" of db2 and more of the "why." i'm fighting
less with the 'this is the way it is' and more of the 'why is it this way?'



First  |  Prev  |  Next  |  Last
Pages: 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Prev: SQL0901N Error.
Next: Convert DECIMAL to DATE