Re: Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java

From: Muhammad Altaf <mmalik_altaf(at)yahoo(dot)com>
To: jonykapil <jony(dot)kapil(at)gmail(dot)com>, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java
Date: 2012-05-15 10:59:46
Message-ID: 1337079586.90024.YahooMailNeo@web121302.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Can you change strSql="{? = call(SFBLPRDBILLDATE(?,?,?,?,?,?))}"; to strSql="{? = call SFBLPRDBILLDATE(?,?,?,?,?,?)}";
 Kind Regards
Altaf Malik

________________________________
From: jonykapil <jony(dot)kapil(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Sent: Tuesday, 15 May 2012 3:52 PM
Subject: [JDBC] Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java

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-using-Java-tp5620617p5708726.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message jonykapil 2012-05-15 12:46:15 Re: Issues with IN-OUT parameters for Array of Objects in EDB using Java
Previous Message Dave Cramer 2012-05-15 10:47:50 Re: Patch: Add support for hstore extension - and map it to/from java.util.Map