Error in implementation(?): Calling Stored Procedures in FireBird 2.1 [message #654343] |
Tue, 15 February 2011 05:06  |
Eclipse User |
|
|
|
Calling a Stored Procedure in FireBird 2.1 results in "SQL error code = -104":
Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 33
=
Error Code: 335544569
Call: EXECUTE PROCEDURE LOGIN1(param1 = ?, param2 = ?)
bind => [onlinetester, test]
Query: DataReadQuery(name="test_proc" )
Apparently EclipseLink generates the following syntax EXECUTE PROCEDURE LOGIN1(param1 = ?, param2 = ?) which isn't proper FireBird 2.1 syntax and should be called via EXECUTE PROCEDURE LOGIN1 ?, ?.
I've described the details of this problem on StackOverflow: http://stackoverflow.com/questions/4960049/executing-stored- procedures-in-firebird-using-jpa-namedstoredprocedurequery
|
|
|
Re: Error in implementation(?): Calling Stored Procedures in FireBird 2.1 [message #654403 is a reply to message #654343] |
Tue, 15 February 2011 10:32   |
Eclipse User |
|
|
|
Hello,
From the other post,
@StoredProcedureParameter(queryParameter = "param1", name = "USER_NAME", direction = Direction.IN, type = String.class),
is telling EclipseLink to execute the procedure using named database parameters. If instead of
EXECUTE PROCEDURE LOGIN1("USER_NAME= ? ) you want EXECUTE PROCEDURE LOGIN1(?) try by removing the name from the StoredProcedureParameter definition, leaving it unnamed:
@StoredProcedureParameter(queryParameter = "param1", direction = Direction.IN, type = String.class),
Best Regards,
Chris
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05204 seconds