pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: cognizant <sudipbajoria@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Issues with IN-OUT parameters for Array of Objects in EDB using Java
Date: Thu, 5 Apr 2012 07:58:40 -0700 (PDT)
Message-ID: <1333637920442-5620617.post@n5.nabble.com> (raw)

Hi 

I am having issues with passing IN-OUT Parameters from a function which
returns a array of custom defined objects. I know that the new version(8.X+)
of EDB support nested tables and so was wondering this issue must be faced
by other java developers when trying to use the nested tables. Note I tried
types.Other, Array and STRUCT to register the output nested table object but
didnot work.

*Below is my SQL code*

create or replace
TYPE OT_Ref_Country AS OBJECT (
    countryId       		Integer,
    isoFullName     	Varchar2(256),
    doNotUseIndicator    	Integer
);

create or replace
TYPE NT_Ref_Countries IS TABLE OF OT_Ref_Country;

FUNCTION getCountryList ( ip_countryId IN
Ref_Country.countryid%TYPE,iop_NT_Ref_Countries in out NT_Ref_Countries
) RETURN Number ;


*Java code:*

CallableStatement  st = con.prepareCall("{call
pkg_ref_geography_mgr.getCountryList(4,?)}");
st.registerOutParameter(1,Types.OTHER);
st.execute();


Please let me know if any additional details are needed. The version used is
Postgresql 8.4 with Java6

Tks for the help
-Mike

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Issues-with-IN-OUT-parameters-for-Array-of-Objects-in-EDB-us...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.



view thread (10+ messages)  latest in thread

Message-ID: <1333637920442-5620617.post@n5.nabble.com>
Permalink:  ../1333637920442-5620617.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1333637920442-5620617.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: sudipbajoria@gmail.com
  Subject: Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java
  In-Reply-To: <1333637920442-5620617.post@n5.nabble.com>
  References: <1333637920442-5620617.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox