It's all about the answers!

Ask a question

Anyone having issues with own SQL code with Jazz Reporting Service ?


Iciar Matilde Olocco y Garcia (731520) | asked May 11 '15, 9:28 a.m.
HI !

I try to create my own SQL queries but in some case, I've received error with try to join two tables and use COUNT function

This is my code:
SELECT
    P.PROJECT_CLASS_ID,
    C.NAME,
    COUNT(P.PROJECT_CLASS_ID) As QProject
FROM RIODS.PROJECT P INNER JOIN RIODS.PROJECT_CLASSIFICATION C ON P.PROJECT_CLASS_ID=C.PROJECT_CLASS_ID
GROUP BY P.PROJECT_CLASS_ID

This is the error:

An unexpected error occurred when validating the input SQL string.

Check the reporting service log file for details.

But if you check both table you can find the information.

Could you help me?





Accepted answer


permanent link
Vinaykumar Saraogi (34) | answered May 11 '15, 9:47 a.m.
JAZZ DEVELOPER
 Hi,

Looks like you forgot to include C.NAME in the GROUP BY clause. The query should be something like this:
SELECT 
    P.PROJECT_CLASS_ID, 
    C.NAME, 
    COUNT(P.PROJECT_CLASS_ID) As QProject 
FROM RIODS.PROJECT P INNER JOIN RIODS.PROJECT_CLASSIFICATION C ON P.PROJECT_CLASS_ID=C.PROJECT_CLASS_ID 
GROUP BY P.PROJECT_CLASS_ID, C.NAME
Iciar Matilde Olocco y Garcia selected this answer as the correct answer

3 other answers



permanent link
Lidija Grahek (461) | answered May 11 '15, 9:39 a.m.
JAZZ DEVELOPER
Hi, You are missing C.NAME in GROUP BY statement.

permanent link
Jackie Albert (1.6k14947) | answered May 11 '15, 9:37 a.m.
Are you able to run this SQL query directly against the database in your DB client?  That might help narrow down if it's an SQL issue or a problem in JRS.

permanent link
Iciar Matilde Olocco y Garcia (731520) | answered May 11 '15, 11:54 a.m.
Thanks a lot every all!

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.