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

PgCallableStatement registerOutParameter for PROCEDURE not ready #1545

Closed
opentissandy opened this issue Aug 21, 2019 · 4 comments
Closed

PgCallableStatement registerOutParameter for PROCEDURE not ready #1545

opentissandy opened this issue Aug 21, 2019 · 4 comments

Comments

@opentissandy
Copy link

opentissandy commented Aug 21, 2019

Class PgCallableStatement registerOutParameter for PROCEDURE not ready, that ONLY for function now.

In Postgresql 11 PROCEDURE is ready. But isFunction in class PgCallableStatement limited registerOutParameter ONLY for fuction. Should update the class PgCallableStatement for Postgresql 11 PROCEDURE.

Driver Version 42.2.7

Java Version JDK 8

OS Version openSuSE 15.0

PostgreSQL Version 11.5

To Reproduce
PgConnection.prepareCall("CALL clone_mozilla_send(?, ?)")

CallableStatement.registerOutParameter(1,..
CallableStatement.registerOutParameter(2,..

Expected behaviour
This statement does not declare an OUT parameter. Use '{' ?= call ... '}' to declare one.

Logs
This statement does not declare an OUT parameter. Use '{' ?= call ... '}' to declare one.

And I crack the class PgCallableStatement with remove isFunction condition, I can get out value use CallableStatement.getXXX.

@davecramer
Copy link
Member

Given that procedures currently cannot be used inside transactions we are wondering what anyone would actually use them for ?

@opentissandy
Copy link
Author

opentissandy commented Aug 22, 2019

Thanks your comments.

I added one test case patch. You can look the test case to find my usage.
Jdbc3CallableStatementTest.java.patch.txt

@opentissandy
Copy link
Author

opentissandy commented Aug 22, 2019

Add my crack to PgCallableStatement.java can work fine. But that ONLY for test my usage, NOT correct patch!!! Put here.
PgCallableStatement.java.patch.txt

gregn123 added a commit to gregn123/pgjdbc that referenced this issue Sep 5, 2019
…tive CALL

Currently, using CallableStatement, the PGJDBC driver will allow invocation of procedures using
the native "call myproc(...)" syntax, provided the procedure only has IN parameters or no
parameters.
However, if the procedure has any INOUT parameters, then an attempt to invoke the
CallableStatement's registerOutParameter() method, which is required in order to register the OUT
part of the INOUT parameter, will fail with the following error:
   This statement does not declare an OUT parameter.  Use { ?= call ... } to declare one.

This fixes issue: pgjdbc#1545
davecramer pushed a commit that referenced this issue Nov 26, 2019
…tive CALL (#1561)

Currently, using CallableStatement, the PGJDBC driver will allow invocation of procedures using
the native "call myproc(...)" syntax, provided the procedure only has IN parameters or no
parameters.
However, if the procedure has any INOUT parameters, then an attempt to invoke the
CallableStatement's registerOutParameter() method, which is required in order to register the OUT
part of the INOUT parameter, will fail with the following error:
   This statement does not declare an OUT parameter.  Use { ?= call ... } to declare one.

This fixes issue: #1545
@davecramer
Copy link
Member

closed by #1561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants