You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/05/02 02:03:06 UTC

[jira] [Closed] (GROOVY-8155) No types when executing PostgreSQL stored procedure

     [ https://issues.apache.org/jira/browse/GROOVY-8155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-8155.
-----------------------------

> No types when executing PostgreSQL stored procedure
> ---------------------------------------------------
>
>                 Key: GROOVY-8155
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8155
>             Project: Groovy
>          Issue Type: Bug
>          Components: SQL processing
>    Affects Versions: 2.4.9, 2.4.10
>            Reporter: Moritz Kobel
>            Assignee: John Wagenleitner
>             Fix For: 2.4.11
>
>
> Since 2.4.9 I can no longer execute stored procedures:
> The following code causes an exception:
> {code}
> def sql = Sql.newInstance(jdbcUrl,user,pass)
>         def result = false
>         sql.call('{? = call myproc(?, ?) }', [
>                 Sql.BOOLEAN,
>                 Sql.BIGINT(1),
>                 Sql.BIGINT(1)
>         ], { res ->
>             result = res
>         })
> {code}
> The exception:
> {code}
> Exception in thread "main" org.postgresql.util.PSQLException: ERROR: function myproc(unknown, unknown, unknown) does not exist
>   Hint: No function matches the given name and argument types. You might need to add explicit type casts.
> {code}
> The exception occurs using 'postgresql:postgresql:9.0-801.jdbc4' and 'org.postgresql:postgresql:42.0.0.jre7'
> I assume the following line causes the execution of the procedure before the parameters are set ({{subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java}} in {{protected void setParameters(List<Object> params, PreparedStatement statement)}} ):
> {code}
> ParameterMetaData metaData = statement.getParameterMetaData();
> {code}
> This line is introduced here: https://github.com/apache/groovy/pull/495/commits/93f703f53b01a0b0205d8efa364c3efb97758d31#diff-c1c769ea9cf64ea997ca82e512653990R4111



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)