GROUP BY not working but is it oracle

i have to write procedures in oracle and use them as datasources in reporting services (microsoft product to create reports). All works well except when I have any query which includes a GROUP BY clause.
For instance this code compiles fine in toad...
CREATE OR REPLACE PROCEDURE RSP_PROJECT_INFO
     IN_PROJECTNAME IN varchar2 :=NULL,
     p_cursor out types.sqlcur
AS
BEGIN
open p_cursor for
SELECT      
          PROJECT.PROJECTID
          MAX(PROJECT.PROJECTNAME) As ProjectName,
          MAX(PROJECT.SUBJECT) AS ProjectCustomer,
          MAX(PROJECT.CATEGORY) As ProjectCategory,
          MAX(PROJECT.AUTHOR) AS ProjectCommission,
          MAX(MANAGER_ID) as ProjectManager,
          MAX(PROJECTED_COMPLETION) AS ProjectedCompletion,
          MAX(PROJECTED_START_DATE) AS ProjectedStartDate,
          MAX(PROJECT.FINISHDATE) AS ProjectFinishDate,
          COUNT(PROJ_TASK.TASKUNIQUEID) as TotalTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_STATUS=2 THEN 1 ELSE 0 END) AS CompletedTasks, 
          SUM(CASE WHEN PROJ_TASK.TASK_STATUS=1 THEN 1 ELSE 0 END) AS  InProgressTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_STATUS=0 THEN 1 ELSE 0 END) AS NotStartedTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=1 THEN 1 ELSE 0 END) AS CCCBTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=2 THEN 1 ELSE 0 END) AS CCFBTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=3 THEN 1 ELSE 0 END) AS ProjectEndMSTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=4 THEN 1 ELSE 0 END) AS ProjectEndTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=6 THEN 1 ELSE 0 END) AS CMSBTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=0 THEN 1 ELSE 0 END) AS OtherTasks
FROM                
          PROJECT
INNER JOIN
        PROJ_TASK
                      ON PROJ_TASK.PROJECTID=PROJECT.PROJECTID
WHERE
       (PROJECT.PROJECTNAME = IN_PROJECTNAME OR IN_PROJECTNAME IS NULL OR IN_PROJECTNAME='All')
       AND (PROJECT.PROJECT_TYPE = 2)
GROUP BY PROJECT.PROJECTID
ORDER BY
       PROJECT.PROJECTNAME;
END;
/But as soon as I run the dataset source in reporting services to obtain the data I get this error message:
Microsoft Development Environment
An error occurred while executing the query.
ORA-00979: not a GROUP BY expression
ORA-06512: at "CONCERTO.RSP_PROJECT_INFO", line 8
ORA-06512: at line 1
OK  
---------------------------But I dont see any issue with my code. I have used the proper aggregate functions and groupped by my id column. What gives and why does this happen only on any query which contains a group by clause.
Even if I did:
Select PROJECTID FROM PROJECT GROUP BY PROJECTIDThis too although very simple sql seems to fail when I try to run the datasource in reporting services with the above error. Can anyone point me to whats wrong ?
Or how to avoid this ?
Thanks,
jon

Thanks mpowel..
very odd I got rid of the ORDER BY clause and it works...
CREATE OR REPLACE PROCEDURE RSP_PROJECT_INFO
     IN_PROJECTNAME IN varchar2 :=NULL,
     p_cursor out types.sqlcur
AS
BEGIN
open p_cursor for
SELECT      
          MAX(PROJECT.PROJECTID),
          MAX(PROJECT.PROJECTNAME) As ProjectName,
          MAX(PROJECT.SUBJECT) AS ProjectCustomer,
          MAX(PROJECT.CATEGORY) As ProjectCategory,
          MAX(PROJECT.AUTHOR) AS ProjectCommission,
          MAX(MANAGER_ID) as ProjectManager,
          MAX(PROJECTED_COMPLETION) AS ProjectedCompletion,
          MAX(PROJECTED_START_DATE) AS ProjectedStartDate,
          MAX(PROJECT.FINISHDATE) AS ProjectFinishDate,
          COUNT(PROJ_TASK.TASKUNIQUEID) as TotalTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_STATUS=2 THEN 1 ELSE 0 END) AS CompletedTasks, 
          SUM(CASE WHEN PROJ_TASK.TASK_STATUS=1 THEN 1 ELSE 0 END) AS  InProgressTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_STATUS=0 THEN 1 ELSE 0 END) AS NotStartedTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=1 THEN 1 ELSE 0 END) AS CCCBTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=2 THEN 1 ELSE 0 END) AS CCFBTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=3 THEN 1 ELSE 0 END) AS ProjectEndMSTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=4 THEN 1 ELSE 0 END) AS ProjectEndTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=6 THEN 1 ELSE 0 END) AS CMSBTasks,
          SUM(CASE WHEN PROJ_TASK.TASK_TYPE=0 THEN 1 ELSE 0 END) AS OtherTasks
FROM                
          PROJECT
INNER JOIN
        PROJ_TASK
                      ON PROJ_TASK.PROJECTID=PROJECT.PROJECTID
WHERE
       (PROJECT.PROJECTNAME = IN_PROJECTNAME OR IN_PROJECTNAME IS NULL OR IN_PROJECTNAME='All')
       AND (PROJECT.PROJECT_TYPE = 2)
GROUP BY PROJECT.PROJECTID;
END;
/Oracle doesnt seem to like to order when you do a group by and the ordering column doesnt appear in your list? ??
I can live with that...

Similar Messages

  • Group chat not working on Mac

    Suddenly stopped working, but personal messages works. Had to login via skype for web and that's where I saw that I had tons of group messages. Tried updating Skype to latest version (7.10), restarted several times, to no avail.  Group Chat is still dead. 

    The same here. Group chats not working, and some 2-person chats not working too.

  • Groups does not work in Mail under Mavericks

    Its not just smart groups, by I cannot get any of my Groups to work with Mail under Mavericks.  I am weary of having to type out the address for each person separately.  Is there some better way?

    I don't know why typing he name of a regular group does not work for you, but…
    Another way is to open the address panel, select a group, then select all in the group, then click the two button.

  • Why iPhone 6 Plus sound microphone not working, but in the case of sound recordings in conversation mode work?

    Why iPhone 6 Plus sound microphone not working, but in the case of sound recordings in conversation mode work?

    Sighhhh, wasted so much time yesterday and today going around Sony centre and then carphone warehouse. They told me to come back after Easter.
    I came home, banged the phone against the wall and it worked.
    Turned out that mic was working on loud speaker and when using headphones so I thought that the secondary mic is working and the main one (placed with the speakers) isn't. So I banged that part against the wall slightly (in plastic case to prevent scratches) then put the phone underwater, waited for it to dry and now it's working. Idk how well and if it's of perfect quality again but people can hear me well.

  • I am using chat-r wireless and facetime is not working but when i put rogers fido or any other carrier sim in it work. Anyone know what the problem?

    I am using chat-r wireless and facetime is not working but when i put rogers fido or any other carrier sim in it work. Anyone know what the problem?

    I'm guessing it's a compatibility problem similar to that that T-Mobile in the US has. I'm not familiar with chat-r wireless, but I'm guessing it's not a supported carrier for the iPhone. If they can't tell you how to fix it, I'm guessing it's just plain not going to work.

  • Mini-Displayport to DVI adapter not working, but Mini-Displayport to VGA and Thunderbolt work fine

    Mini-Displayport to DVI adapter not working, but Mini-Displayport to VGA and Thunderbolt work fine.
    This is a brand new MacBook Pro (15-inch, mid-2012) just received.  I suspect that this is a hardware problem as:
    The mini-displayport to DVI adapter and the external monitor that I am utilizing connect and operate just fine using my older MacBook Pro (mid-2010) with the same OS.
    The new MacBook Pro powers the external monitor with a mini-displayport to VGA adapater without issue.
    The new MacBook Pro powers an Apple Thunderbolt display without issue.
    Both MacBook Pro's are running OSX Lion 10.7.4.
    The only combination which does not work is the mini-displayport to DVI adapater used in conjunction with the brand new MacBook Pro (mid-2012).
    All adapters and components (mini-displayport adapters) are Apple retail adapter.
    I have tried several external monitors, including my Dell U2412m.
    When I connect the mini-displayport to DVI adapater to the new MacBook Pro (mid-2012), nothing happens. The external monitor reports "no signal" and attempts to go into sleep mode.  Using the "Detect displays" button has no effect, even when used multiple times.  Rebooting does not help, nor does resetting the SMC or PRAM.
    Any other suggestions before I take it to the Genius Bar?

    I turns out that the logic board of my MacBook Pro was faulty (despite being brand new).
    I took it to the Apple Store, presented the problem, and one of the Tech's came to the same conclusion that I had -- hardware failure.  Phone support was no help in the matter (and even told me that what I was trying to do wasn't a supported option, which is rediculous).  However, the Genius Bar did take care of the problem, and my MacBook Pro was back to me with a replaced logic board within a few days.
    Hope that htis helps.

  • Hi am trying to save Data into a write to measurement file vi using a NI PXI 1042Q with a real time mode but it is not working but when i run it with uploading it into the PXI it save in to the file

    Hi am trying to save Data into a write to measurement file vi using a NI PXI 1042Q and DAQ NI PXI-6229 with a real time mode but it is not working but when i run it without uploading it into the PXI it save in to the file please find attached my vi
    Attachments:
    PWMs.vi ‏130 KB

     other problem is that the channel DAQmx only works at real time mode not on stand alone vi using Labview 8.2 and Real time 8.2

  • My home button is not working but apple will not honor the limited warranty

    My home button on my ipod touch is not working but Apple will not honor the limited warranty because the corner glass is craked.  I have been using it cracked for months.  What is my legal recourse.  I think it is unfair!!!!!!

    tracy252 wrote:
    My home button on my ipod touch is not working but Apple will not honor the limited warranty because the corner glass is craked.  I have been using it cracked for months.  What is my legal recourse.  I think it is unfair!!!!!!
    Hire a lawyer.

  • HT204023 hi there can any one help me i have a iphone 5 but my mobile internet not working but i can connect to my wifi no bother

    hi there can any one help me i have a iphone 5 but my mobile data is not working but a can connect to my wifi no bother

    talk to your carrier about the data subscription and possible settings changes to their apn than

  • I need to get into contact with Adobe support on renewal of my CC subscription which does not work but I cannot find any PHONE number just the referral to this forum - help, what should I do?? Thanks!!

    I need to get into contact with Adobe support on renewal of my CC subscription which does not work but I cannot find any PHONE number just the referral to this forum - help, what should I do?? Thanks!!

    Use the web chat:
    Contact Customer Care
    Mylenium

  • The ringer of my iphone 4s is not working but when itried to go in setting then sound and tried to change ringtone the ringer is working..pls help

    the ringer of my iphone 4s is not working but when itried to go in setting then sound and tried to change ringtone the ringer is working..pls help

    Check the mute switch along the side, near the external volume controls.

  • My trackpad in Macbook is not working properly. The tap and double tap is not working but other gestures are working. Please help me..thanks

    My trackpad in Macbook is not working properly. The tap and double tap is not working but other gestures are working. Please help me..thanks

    Portables and Magic Trackpad: Jumpy or erratic trackpad operation
    Might be something from that link that will help.

  • Java currently not working, but was working previously. Change occurs around updates.

    I need Java to upload info to a GoDaddy website. Java was working in January, then did not work. It worked again after an update, then stopped working about the time of another Firefox update. Currently, Java is not working, but I am able to upload thru Internet Explorer. I seem to have the latest Java for Firefox installed, it is enabled so I am at a lost. Did an update not install properly? I am really at a lost since success and failure seem to be tied to Firefox updates.

    >
    You should be aware that this is a forum for discussion for Java developers. It is not an end user support forum.
    At any rate your issue is a problem with the site in question. "java.lang.NoClassDefFoundError: PChatPanel" means that resources the program needs cannot be found. This is a problem with that site and you will have to address it with them in order to resolve it. Nobody else can help you with this because it is a site problem and beyond our control.

  • I m using apple mac pc, when we start windows 7 , apple mouse doesn't work properly it take to much time to gain signals from the pc and many times it not work but when we use mac it moves fastly and works properly. please suggest me. thanks ravi

    i m using apple mac pc, when we start windows 7 , apple mouse doesn't work properly it take to much time to gain signals from the pc and many times it not work but when we use mac it moves fastly and works properly. please suggest me.
    thanks
    ravi
    <Email removed by Host>                                                                                                                                                                                                                                       

    sounds more like Bluetooth rather than moue, but w/o knowing w/o posting mac model type/year we... will... not... know... what you have
    All computers are personal computers, a PC though is also "non-Apple" in common usage.
    Mac also is platform and OS.
    Very confused reading what you are trying to tell us.

  • My speakers are not working but it still makes a sound when it boots up

    my speakers are not working but it still makes a sound when it boots up.

    Take each of the following steps that you haven't already tried.
    1. Start with the steps recommended in this support article.
    2. If your model has an audio-out (headphone) port, and a red light is coming from it, the internal switch is stuck in the position for digital output. You may be able to free it by inserting and removing a mini-stereo jack of the proper size. Inserting any kind of tool in the port may cause damage that won't be covered by your warranty.
    If there's no red light, the switch may still be stuck in the headphone position. Try to free it the same way.
    3. Boot in safe mode. Don't log in; just reboot as usual when the login screen appears. When you do, make sure the words "Safe Boot" do not appear in the login screen. If they do, the system is still in safe mode and sound won't work.
    4. Reset the NVRAM.
    5. Reset the SMC.
    6. Reinstall OS X after backing up all data.
    7. Make a "Genius" appointment at an Apple Store.

Maybe you are looking for