Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Query works in isql, not through java

2 posts in General Discussion Last posting was on 2009-12-04 18:12:50.0Z
David Kerber <ns_dkerber Posted on 2009-12-04 18:07:46.0Z
From: David Kerber <ns_dkerber@ns_warrenrogersassociates.com>
Newsgroups: ianywhere.public.general
Subject: Query works in isql, not through java
Message-ID: <MPG.258319e8fd3058ed989683@forums.sybase.com>
Organization: Warren Rogers Associates
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.9.13
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 4 Dec 2009 10:07:46 -0800
X-Trace: forums-1-dub 1259950066 10.22.241.152 (4 Dec 2009 10:07:46 -0800)
X-Original-Trace: 4 Dec 2009 10:07:46 -0800, vip152.sybase.com
Lines: 31
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7809
Article PK: 6846

SA server version 9.0.2.3456 32-bit, client has 9.0.2.3886 32-bit on
win7 x64. I'm using the 32-bit jvm and 32-bit Eclipse for development,
so the entire query chain is 32-bit.

When I execute the following query in my application, I get the error
listed at the bottom. when executed throught isql or a 3rd-party odbc
database management tool, it works fine, so the problem appears to be
something with the jdbc-odbc bridge. Any suggestions? I have made sure
that the app is using the version of jodbc.jar from my ASA installation,
and not the one that came with the jre.

Any suggestions? I'm setting up to try this on xp 32-bit, but I'm not
there yet.


SELECT s.GrossSales, s.NetSales, s.SalesTemperature, s.DateGenerated,
s.SalesTypeKey, s.SalesKey, s.ObservationTime, s.FuelSysKey,
s.DataSummKey, s.Shift, getAllBlendedSales( s.datasummkey,
d.dategenerated, s.dategenerated, s.SalesTypeKey, 0 ) AS BlendSales,
getAllBlendedSales( s.datasummkey, d.dategenerated, s.dategenerated,
s.SalesTypeKey, 1 ) AS NetBlendSales
FROM Sales s JOIN DataSumm d ON d.DataSummKey = s.DataSummKey
WHERE s.DataSummKey in ( 622829, 623047, 623319, 623590, 623764, 624062,
624285, 624588, 624813 )
ORDER BY s.ObservationTime, s.Shift, s.DataSummKey, SalesTypeKey,
s.DateGenerated


java.sql.SQLException: [Sybase][ODBC Driver][Adaptive Server Anywhere]
Function or column reference to 'GROSSSALES' must also appear in a GROUP
BY


David Kerber <ns_dkerber Posted on 2009-12-04 18:12:50.0Z
From: David Kerber <ns_dkerber@ns_warrenrogersassociates.com>
Newsgroups: ianywhere.public.general
Subject: Re: Query works in isql, not through java
Message-ID: <MPG.25831b299a1ebc7c989684@forums.sybase.com>
References: <MPG.258319e8fd3058ed989683@forums.sybase.com>
Organization: Warren Rogers Associates
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.9.13
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 4 Dec 2009 10:12:50 -0800
X-Trace: forums-1-dub 1259950370 10.22.241.152 (4 Dec 2009 10:12:50 -0800)
X-Original-Trace: 4 Dec 2009 10:12:50 -0800, vip152.sybase.com
Lines: 5
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7810
Article PK: 6845

In article <MPG.258319e8fd3058ed989683@forums.sybase.com>,
ns_dkerber@ns_warrenrogersassociates.com says...

Oops, wrong group.