Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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?





1 vote


Accepted answer

Permanent link
 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

1 vote


3 other answers

Permanent link
Hi, You are missing C.NAME in GROUP BY statement.

1 vote


Permanent link
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.

0 votes


Permanent link
Thanks a lot every all!

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 360
× 28

Question asked: May 11 '15, 9:28 a.m.

Question was seen: 4,168 times

Last updated: May 11 '15, 11:54 a.m.

Confirmation Cancel Confirm