Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > IBM DB2 > Question about ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 8980 of 9520
Post > Topic >>

Question about SQL0214N

by Lennart <Erik.Lennart.Jonsson@[EMAIL PROTECTED] > Jun 14, 2008 at 12:43 PM

Just curios, given tables:

[lelle@[EMAIL PROTECTED]
 share]$ db2 "create table A (c1 char(2) not null)"
DB20000I  The SQL command completed successfully.
[lelle@[EMAIL PROTECTED]
 share]$ db2 "create table B (c1 char(2) not null)"
DB20000I  The SQL command completed successfully.

why is the following illegal:

[lelle@[EMAIL PROTECTED]
 share]$ db2 "select c1 from A union select c1 from B
order by ucase(c1)"
SQL0214N  An expression in the ORDER BY clause in the following
position, or
starting with "UCASE..." in the "ORDER BY" clause is not valid.
Reason code =
"1".  SQLSTATE=42822

but:

[lelle@[EMAIL PROTECTED]
 share]$ db2 "select c1 from (select c1 from A union
select c1 from B) X order by ucase(c1)"

is ok? The only reason I can think of is that X is guaranteed to be
evaluated before order by, but I'm not sure that this is true. Anyone
care to fill in the details?


/Lennart
 




 4 Posts in Topic:
Question about SQL0214N
Lennart <Erik.Lennart.  2008-06-14 12:43:54 
Re: Question about SQL0214N
"Dave Hughes" &  2008-06-15 09:29:45 
Re: Question about SQL0214N
"Dave Hughes" &  2008-06-15 09:56:53 
Re: Question about SQL0214N
Lennart <Erik.Lennart.  2008-06-15 10:36:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 20:58:12 CST 2008.