pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jonykapil <jony.kapil@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java
Date: Mon, 14 May 2012 22:52:02 -0700 (PDT)
Message-ID: <1337061122958-5708726.post@n5.nabble.com> (raw)
In-Reply-To: <1333717349570-5622702.post@n5.nabble.com>
References: <1333637920442-5620617.post@n5.nabble.com>
	<1333710841.58069.YahooMailNeo@web110406.mail.gq1.yahoo.com>
	<1333717349570-5622702.post@n5.nabble.com>

Hi, This is my first post on the forum. Hope, I'll get a resolution to my
problem. 

We are in process of migration from Oracle 10g to Postgres9.1 Advance
Server. The stored procedures/functions from Oracle have some parameters
registered as Out parameters. Now, when we call it from Java, an exception
thrown -: 

*org.postgresql.util.PSQLException: Malformed function or procedure escape
syntax at offset 9.*

The signature of Postgres Function is as :: 

*sfblprdbilldate(IN p_billdate numeric, IN p_cutoffday numeric, IN
p_billfreq character varying, IN p_givendate timestamp without time zone,
OUT po_startdate timestamp without time zone, OUT po_end_date timestamp
without time zone)*


Java code for calling this function is as follows :: 

  *strSql="{? = call(SFBLPRDBILLDATE(?,?,?,?,?,?))}"; 

                   objCstmt = objConn.prepareCall(strSql); 
                   objCstmt.registerOutParameter(1,Types.VARCHAR); 
                   objCstmt.setInt(2,iBillDay); 
                   objCstmt.setInt(3,iBillDay); 
                   objCstmt.setString(4,strBillFrequency); 
                   objCstmt.setDate(5,dtSysDate); 
                   objCstmt.registerOutParameter(6,Types.DATE); 
                   objCstmt.registerOutParameter(7,Types.DATE); 
                   objCstmt.execute(); 
                   strBillPeriod = objCstmt.getString(1); 
                   dtStartDate   = objCstmt.getDate(6);*Anybody, who has
resolved this sort of issue, please help me as this is in numbers in our
code and we are looking for a solutuin to this problem. 

Thanks 
Jony.

--
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: <1337061122958-5708726.post@n5.nabble.com>
Permalink:  ../1337061122958-5708726.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1337061122958-5708726.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: jony.kapil@gmail.com
  Subject: Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java
  In-Reply-To: <1337061122958-5708726.post@n5.nabble.com>
  References: <1333637920442-5620617.post@n5.nabble.com> <1333710841.58069.YahooMailNeo@web110406.mail.gq1.yahoo.com> <1333717349570-5622702.post@n5.nabble.com> <1337061122958-5708726.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