MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » October 2012

Bug in SQL parser???



fixed

<disclaimer>I posted this message on comp.sys.ibm.as400.misc too: sorry for the cross-post, but that newsgroup seems a bit negleted</disclaimer>

I'm trying to support AS400 database in Activiti (http://www.activiti.org).
This open source project creates lots of query like this:

SELECT SUB.* FROM
(select
RES.* , row_number() over (Order by A.field1) rnk
FROM (select A.field1, B.field1 from A inner join B on A.X = B.Y) RES
) SUB
WHERE SUB.rnk >= ? AND SUB.rnk < ?

Unfortunately this query fails with msg SQL5001 - Column qualifier or table
A undefined.

Note that if I change my statement this way:
SELECT SUB.* FROM
(select
RES.* , row_number() over (Order by NEW_NAME) rnk
FROM (select A.field1 NEW_NAME, B.field1 from A inner join B on A.X = B.Y)
RES
) SUB
WHERE SUB.rnk >= ? AND SUB.rnk < ?

all works fine (but I can't modify Activiti this way :-).
Is it a bug of SQL parser or I don't understand something?
Any suggestion?

Thanks!

Bye

Franco

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.francolombardo.net
Scala, Java, As400.....
http://twitter.com/f_lombardo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact