henriquerr Posted February 22, 2010 Share Posted February 22, 2010 I`m trying to use MySQL variable in Report Query but iReport accuses SQL syntax error.To use MySQL variable I should put SET @varname := value;Because of the semi colon I get a MySQL syntax error after the semi colon." You have an error in your SQL syntax; ... near 'SELECT DATE_ADD(.....)' "Code:SET @num := -1;SELECT DATE_ADD('2009-08-24',INTERVAL @num := @num + 1 DAY) AS dayFROM log Link to comment Share on other sites More sharing options...
mrcaffeine Posted February 22, 2010 Share Posted February 22, 2010 the report query can only execute one sql query, you are sending 2 commands. You might need to use a stored procedure instead. refer the JasperReports documentation for limitations on stored procedures. Link to comment Share on other sites More sharing options...
henriquerr Posted February 23, 2010 Author Share Posted February 23, 2010 There`s any way to execute this SET @num := -1; before execute the other query? Maybe some trick... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now