Jump to content
We've recently updated our Privacy Statement, available here ×

Possible to set SQL system variables in iReport? Or use SQL variables in report query?


lisaws
Go to solution Solved by hozawa,

Recommended Posts

I want to increase the max length of the group_concat function for my report.  Normally (not in Jasper) I would do the following:

SET SESSION group_concat_max_len = 10000;[/code]

But if I add that to the beginning of my Jasper report query, I get an error when running the report ("An error has occurred...").  Is there any way to set SQL system variable such as this in Jasper iReport?

I am using Jasper iReport 5.2.0 and MySQL db.  Thanks.

 

EDIT: also, I've tried a workaround to avoid using group_concat which uses user-defined variables, for example:

SELECT resultFROM   (SELECT @result := '',               (SELECT result                FROM   (SELECT @result := CONCAT_WS(';', @result, field2) AS result,                               LENGTH(@result)                            AS blength                        FROM   some_table                        ORDER  BY blength DESC                        LIMIT  1) AS sub1) AS result) AS sub2; [/code]

But I am getting the same error, " An error has occurred. Please contact your system administrator. (6632)".  I am guessing this is because Jasper doesn't allow SQL variables?

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...