sagarnikam123 Posted January 28, 2013 Share Posted January 28, 2013 I am using Ubuntu 12.04, iReport-4.7, MySQL database, mysql-jdbc driverI write stored procedure in MySQLDELIMITER //CREATE PROCEDURE first()BEGINselect * from person where id in (11,22,33);END //DELIMITER;which return id & name as fields & calling it from iReportselect id+1,name from (call first)gives me syntax error, Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call first)' at line 1but when I run call first in query executor,no errorHow should I get required field for further calculations ? Does this is possible in MS-SQL ? Link to comment Share on other sites More sharing options...
ernestoo Posted January 30, 2013 Share Posted January 30, 2013 Syntax is messed up in the post, can you see if you can remove the HTML docration or whatever is going on? Link to comment Share on other sites More sharing options...
djohnson53 Posted January 30, 2013 Share Posted January 30, 2013 Fixed the posting problem. Link to comment Share on other sites More sharing options...
djohnson53 Posted January 30, 2013 Share Posted January 30, 2013 Help with MySql Stored Procedures: You may find the Stored Procedures User Forum of use when working with stored procedures and functions. For answers to some commonly asked questions regarding stored routines in MySQL, see Section B.4, “MySQL 5.0 FAQ: Stored Procedures and Functions”. There are some restrictions on the use of stored routines. See Section E.1, “Restrictions on Stored Programs”. Binary logging for stored routines takes place as described in Section 18.6, “Binary Logging of Stored Programs”. Link to comment Share on other sites More sharing options...
djohnson53 Posted January 30, 2013 Share Posted January 30, 2013 Hope this helps. Link to comment Share on other sites More sharing options...
djohnson53 Posted January 30, 2013 Share Posted January 30, 2013 Not sure, but are you missing parens in the function call?select id+1,name from (call first()) 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