Hey Lukas,

On Mon, Nov 26, 2012 at 8:49 AM, Lukas Eder <[email protected]> wrote:

>
> I doubt that there is a subquery-related problem here. Probably the
> problem you're facing is a problem related to case-sensitivity. Note
> that jOOQ's "plain SQL" is what it is called. Plain SQL. jOOQ does not
> modify / introspect that. So when you write:
>
> Factory.field("day"), you're getting a case-insensitive, unquoted
> reference to a DAY identifier. By default (in many databases),
> case-insensitive identifiers are in fact all uppercase. When you're
> writing someField.as("day"), you're getting a case-sensitive, quoted
> reference / declaration of a "day" identifier with lower-case letters.
> i.e. your DAY and "day" identifiers just aren't the same...
>


That's a very good point that I hadn't considered - I spent too much time
looking in the wrong place and came up with a rendering workaround that
wasn't necessary. So if I rewrite the query to take the case
(in)sensitivity into account, i.e. just alway use upper case for names,
then I don't need to fumble around with low level identifier rendering.

In hindsight, the case-sensitivity seems like such an obvious solution, so
I'm sorry for wasting your time going on a wild goose chase. Your points
about the general handling of identifiers across different databases are
sensible as well - it sounds like your are speaking out of experience.

Thanks for your help,

Cheers,

Ben

Reply via email to