Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation @Procedure generating one too many argument #3647

Open
MarcTerrasson opened this issue Oct 18, 2024 · 0 comments
Open

Annotation @Procedure generating one too many argument #3647

MarcTerrasson opened this issue Oct 18, 2024 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@MarcTerrasson
Copy link

Hi,

I used @procedure annotation to call a stored procedure in a MS SQL-Server and it create one argument too many.
I tried with @query and it's ok.

With @procedure

    @Procedure(procedureName = "import.SP_CreateImport")
    Integer createImport(String categoryCode, String typeCode, String name);

result in

bdo-connector-1  | 2024-10-18T14:11:58.212Z DEBUG 1 --- [bdo-timsheet-extractor] [           main] org.hibernate.SQL                        :
bdo-connector-1  |     {call import.SP_CreateImport(?, ?, ?, ?)}
bdo-connector-1  | Hibernate:
bdo-connector-1  |     {call import.SP_CreateImport(?, ?, ?, ?)}
bdo-connector-1  | 2024-10-18T14:11:58.265Z  WARN 1 --- [bdo-timsheet-extractor] [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 8144, SQLState: S0002
bdo-connector-1  | 2024-10-18T14:11:58.266Z ERROR 1 --- [bdo-timsheet-extractor] [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : Procedure or function SP_CreateImport has too many arguments specified.

With @query

    @Query(value = "{CALL import.SP_CreateImport(:categoryCode, :typeCode, :name)}", nativeQuery = true)
    Integer createImport(@Param("categoryCode") String categoryCode, @Param("typeCode") String typeCode, @Param("name") String name);

result in

bdo-connector-1  | 2024-10-18T14:27:43.417Z DEBUG 1 --- [bdo-timsheet-extractor] [           main] org.hibernate.SQL                        :
bdo-connector-1  |     {CALL import.SP_CreateImport(?, ?, ?)}
bdo-connector-1  | Hibernate:
bdo-connector-1  |     {CALL import.SP_CreateImport(?, ?, ?)}
bdo-connector-1  | 2024-10-18T14:27:43.488Z  WARN 1 --- [bdo-timsheet-extractor] [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 50001, SQLState: S0001
bdo-connector-1  | 2024-10-18T14:27:43.489Z ERROR 1 --- [bdo-timsheet-extractor] [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : Impossible to find import category [IMPORT -> CATEGORY -> XXX]

I still have work to do but the last issue lies in my SQL stored procedure, not in Java.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants