Re: ORA-00937 error

From: morph <morph_iggy_at_yahoo.com>
Date: 29 Mar 2004 14:14:58 -0800
Message-ID: <732bbd3a.0403291414.3acdb0d_at_posting.google.com>


jmeitz_at_hotmail.com (Jeremie) wrote in message news:<1cb4c644.0403180956.18805158_at_posting.google.com>...
> When I run this simple sql statement out of VB 6.0 i get the ORA-00937
> error.
>
> select count(*) as SeqNbr from tca_plant_assgn where empID = '14995'
> and outage_cd = 'C10BO'
>
> if I leave off the where clause it works fine. If I put the first SQL
> statement directly into Oracle it works fine. Not sure why it wont
> work out of VB 6?

Try popping up a message box at runtime for the SQL string that VB is sending to Oracle to be executed. It is possible it is sending a different query than the one you have listed above.

The ORA-00937 error relates to GROUP BY. If you are getting that error in VB, it is possible the queries are different. Below is a segment from Oracle's Error Messages PDF:

ORA-00937 not a single-group group function Cause: A SELECT list cannot include both a group function, such as AVG,
COUNT, MAX, MIN, SUM, STDDEV, or VARIANCE, and an individual column expression, unless the individual column expression is included in a GROUP
BY clause.
Action: Drop either the group function or the individual column expression
from the SELECT list or add a GROUP BY clause that includes all individual
column expressions listed. Received on Tue Mar 30 2004 - 00:14:58 CEST

Original text of this message