Skip site navigation (1) Skip section navigation (2)

Re: problem with returning a table

From: Kris Jurka <books(at)ejurka(dot)com>
To: Ejder DAŞKIN <1030515082(at)erciyes(dot)edu(dot)tr>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: problem with returning a table
Date: 2005-03-28 09:31:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

On Mon, 28 Mar 2005, [ISO-8859-9] Ejder DAKIN 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")
> 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);

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

In response to

pgsql-jdbc by date

Next:From: fakeDate: 2005-03-30 09:16:47
Subject: jdbc/callable statment error
Previous:From: John SmithDate: 2005-03-28 09:29:15
Subject: problem with returning a table

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group