-
Notifications
You must be signed in to change notification settings - Fork 427
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
TVP Handling is causing exception when calling SP with return value #80
Comments
@bergerdenes thank you for filling this issue. We are able to reproduce the issue. Also, at the meantime, please try to use |
@bergerdenes please let us know if the PR #82 works for you. Thank you. |
@v-xiangs I have tried the workaround solution earlier (the explicit setStructured call with passing the TVP name from the database), it worked fine. |
Tried out, works fine! |
@bergerdenes thank you for finding the issue and testing out the fix. I will go ahead and close this issue then, thank you again. |
fix issue TVP Handling is causing exception when calling SP with return value #80
I also thank you for reacting on it so quickly :) |
@bergerdenes - We should have another "technical preview" release coming out in early January. We will be uploading that release to Maven as well. Please keep in mind that this will be a "preview" release and not RTW 😄 |
When the SQLServerCallableStatement is called with prepareCall("{call SPNAME}") and Structured parameter is added to the statement, the call is successful.
However when the caller would need the return value from the call, that is prepareCall("{? = call SPNAME}") is used (with the first parameter placeholder for the return value) and also this is registered with registerOutParameter(1, Types.INTEGER), the execution of the statement fails because the SQLServerParameterMetaData class in the driver tries to get a nonexisting row from the sp_sproc_columns call result (to determine the TVP name from the database with this internal sp call).
The erroneus line is in the SQLServerParameterMetaData.verifyParameterPosition method, when calling the rsProcedureMeta.absolute(param+1). Here the +1 should be checked and added only if there is no return value parameter expected.
The text was updated successfully, but these errors were encountered: