why is column being returned?

View: New views
2 Messages — Rating Filter:   Alert me  

why is column being returned?

by Geoff hendrey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

I am doing something like:

SELECT
    "A"."C1" AS "A.C1",
    "A"."C2" AS "A.C2"
FROM
    ATABLE AS "A"
WHERE
    "A"."C1" = "X"
ORDER BY
    PK

Does it make sense that PK should be returned in the result set? I expected ONLY "A.C1" and "A.C2" to be the column names returned by JDBC...but I see "PK" as well. It may be a bug in my code somewhere else, or is it possible that the ORDER BY is forcing "PK" to be returned?

-geoff


Re: why is column being returned?

by Bryan Pendleton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Geoff hendrey wrote:

> Hi,
>
> I am doing something like:
>
> SELECT
>     "A"."C1" AS "A.C1",
>     "A"."C2" AS "A.C2"
> FROM
>     ATABLE AS "A"
> WHERE
>     "A"."C1" = "X"
> ORDER BY
>     PK
>
> Does it make sense that PK should be returned in the result set? I
> expected ONLY "A.C1" and "A.C2" to be the column names returned by
> JDBC...but I see "PK" as well. It may be a bug in my code somewhere
> else, or is it possible that the ORDER BY is forcing "PK" to be returned?

I think that it *is* due to the ORDER BY, and I think that it is
incorrect behavior. I noticed this myself a while back and tried
to pin it down, but I was having trouble isolating a standalone
reproducible test case.

If you can construct a simple standalone test program which demonstrates
this behavior, I think it would be great if you could log it into JIRA
so we can track it and study it more.

thanks,

bryan