Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> parameter field not working in group by clause

parameter field not working in group by clause

From: Gerry <gerry-q_at_gmx.de>
Date: 11 Jul 2002 02:58:09 -0700
Message-ID: <58cf73e.0207110158.57c6b3de@posting.google.com>


Hello,
I have a problem with a parameter field in my statement of queryDataset.
Because my select uses SUM(), i have to add a group by clause with the parameter field, but this always produces an ora-error:

ORA-00979 not a GROUP BY expression

this is the statement i use:

SELECT RPAD( SUBSTR( TO_CHAR( TITEL ), 1, :STELLEN ), 5, '0' ) AS TITEL,

        SUM( BETRAG )
FROM	KONTO
WHERE	TO_CHAR( TITEL ) LIKE ( SUBSTR( TO_CHAR( :TITEL ), 1, :STELLEN )
|| '%' )
GROUP BY RPAD( SUBSTR( TO_CHAR( TITEL ), 1, :STELLEN ), 5, '0' ) Using a preparedStatement returns the same error. When i set a number instead of the parameter it works fine.

We use an oracle 8.1.7 database and I tested the statement using severel jdbc-thin drivers ( 8.1.6, 8.1.7.1, 9.2.0.1 ) without success. Do anyone know something about that error?

any solution would be helpful.

Thanks
Gerry Received on Thu Jul 11 2002 - 04:58:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US