Re: problem with returning a table - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: problem with returning a table
Date
Msg-id Pine.BSO.4.56.0503280427030.16785@leary.csoft.net
Whole thread Raw
In response to problem with returning a table  (Ejder DAŞKIN <1030515082@erciyes.edu.tr>)
List pgsql-jdbc

On Mon, 28 Mar 2005, [ISO-8859-9] Ejder DA�KIN wrote:

> There is a  function that returns a table.  I set out parameter's type
> to  Types.OTHER but When I call the function in java, returning type is
> returned as INTEGER .
>
> CREATE OR REPLACE FUNCTION sube_getir(int4, "varchar")
>  RETURNS SETOF subeler AS
>
> sc = conn.prepareCall("{ ? = call sube_getir( ? , ? ) }");
>            sc.registerOutParameter(1,Types.OTHER);
>            sc.setInt(2,4);
>            sc.setString(3,"");
>            sc.execute();
>            rs = (ResultSet)sc.getObject(1);
>

http://jdbc.postgresql.org/documentation/80/callproc.html#callproc-resultset

As the documentation describes there are two methods for getting
ResultSets from a stored procedure.   You have mismatched the
calling convention with the function you have written.

Kris Jurka




pgsql-jdbc by date:

Previous
From: John Smith
Date:
Subject: problem with returning a table
Next
From: fake@dusk.homelinux.org
Date:
Subject: jdbc/callable statment error