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

stored procedures with multiple OUT parameters #1666

Closed
1 task
SureshKonathala opened this issue Jan 3, 2020 · 1 comment
Closed
1 task

stored procedures with multiple OUT parameters #1666

SureshKonathala opened this issue Jan 3, 2020 · 1 comment

Comments

@SureshKonathala
Copy link

I'm submitting a question regarding stored procedure OUT parameters

  • [ X] bug report
  • feature request

Describe the issue
I am trying to call a stored procedure with multiple OUT parameters, But I am getting below error

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

Are OUT parameters supported for stored procedures or they have to be functions ?

Driver Version? 42.2.9

Java Version? 10.0.2

OS Version? Mac

PostgreSQL Version? 11.5

To Reproduce
Steps to reproduce the behaviour:
PROC = "CALL filter(filterid=>?, code=>?, cursor=>?, row_no=> ?)"
The first two are IN parameters
Last two are OUT parameters

callableStatement.registerOutParameter(3, Types.OTHER)
The above throws this error
"This statement does not declare an OUT parameter. Use '{' ?= call ... '}' to declare one."

Expected behaviour
When I wrap the sql with { } it thinks that it is function and I get an error saying, No such function.

Logs
org.postgresql.util.PSQLException: This statement does not declare an OUT parameter. Use { ?= call ... } to declare one.
at org.postgresql.jdbc.PgCallableStatement.registerOutParameter(PgCallableStatement.java:205)

@davecramer
Copy link
Member

see #1560

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