🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #385

Re: ORA-00979 Group By error message

#385
From: Bud1960
Date: Mon, 25 Sep 2006 19:42
85 lines
3843 bytes
"Bud1960" <amanz@northweststate.edu> wrote:
>
>Hello,
>
>I have an Oracle SQL script called "Time_Sheet_Progress.sql"
that causes an ORA-00979 GROUP BY error when run in BDS, but runs
fine in both SQL*Plus and TOAD.
>
>[script]
>SELECT a.spriden_last_name AS "Emp Last Name",
>       a.spriden_first_name AS "Emp First Name",
>       b.spriden_last_name AS "Mgr Last Name",
>       b.spriden_first_name AS "Mgr First Name",
>       case when perjobs_status_ind = 'C' then 'Complete'
>            when perjobs_status_ind = 'A' then 'Approved'
>            when perjobs_status_ind = 'E' then 'Error'
>            when perjobs_status_ind = 'I' then 'InProcess'
>            when perjobs_status_ind = 'R' then 'Returned'
>            when perjobs_status_ind = 'P' then 'Pending'
>            else perjobs_status_ind
>       end AS "Job Status",
>       case
>         when perrout_queue_status_ind = 'A' then 'Approved'
>         when perrout_queue_status_ind = 'O' then 'Overridden'
>         when perrout_queue_status_ind = 'Q' then 'InQueue'
>         when perrout_queue_status_ind = 'P' then 'Pending'
>         else perrout_queue_status_ind
>       end AS "Queue Status",
>       perjobs_comment AS "Comment",
>       perrout_status_date_time AS "Status Date",
>       perjobs_payno AS "Pay No",
>       SUM(NVL(perhour_hrs,0)) AS "# Hrs."
>  FROM spriden a,
>       spriden b,
>       perrout,
>       perhour,
>       perjobs
>WHERE  a.spriden_pidm = perjobs_pidm
>   AND a.spriden_change_ind IS NULL
>   AND b.spriden_pidm = perrout_appr_pidm
>   AND b.spriden_change_ind IS NULL
>   AND perhour_jobs_seqno (+) = perjobs_seqno
>   AND perrout_jobs_seqno = perjobs_seqno
>   AND perjobs_payno = :payno -- perjobs_payno is an integer value
>GROUP BY a.spriden_last_name,
>         a.spriden_first_name,
>         b.spriden_last_name,
>         b.spriden_first_name,
>         perjobs_status_ind,
>         perrout_queue_status_ind,
>         perjobs_comment,
>         perrout_status_date_time,
>		 perjobs_payno
>[/script}
>
>[code]
>
>TStringList *sl = new TStringList;
>sl->LoadFromFile("Time_Sheet_Progress.sql");
>ADOQuery1->SQL->Text = sl->Text;
>
>ADOQuery1->Parameters->ParseSQL(ADOQuery1->SQL->Text, true);
>ADOQuery1->Parameters->Items[0]->Value = txtPayNo->Text.ToInt();
>
>  // Set the query in active mode.
>try {
>	ADOQuery1->Active = true;
>// ... other stuff
>} catch (Exception &ex) {
>// The error brings me here...
>	ShowMessage("There has been an error.\rPlease notify the Computer Center of the following message:\r\r\t" + ex.Message);
>}
>[/code}
>
>If anyone has any idea how to work around this, please post it.
>
>TIA,
>Bud


Also, I apologize for not pressing enter at the end of each line, 
causing long line lengths, please forgive me! 

Bud
Technical Details
Message-ID: <4518312f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!out02a.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <45182f98$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,eb84d3ca99d5dde4
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bud1960" <amanz@northweststate.edu>
Sender: "Bud1960" <amanz@northweststate.edu>
Reply-To: "Bud1960" <amanz@northweststate.edu>
Subject: Re: ORA-00979 Group By error message
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 205.133.102.124     
References:  <45182f98$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <4518312f$1@newsgroups.borland.com>
Date: 25 Sep 2006 12:42:39 -0700
X-Trace: newsgroups.borland.com 1159213359 207.105.83.66 (25 Sep 2006 12:42:39 -0700)
Lines: 85
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!out02a.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail