Re: stored procedure call is not working with "select procedure()" option

From: Abhra Kar <abhra(dot)kar(at)gmail(dot)com>
To: Alban Hertroys <haramrae(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: stored procedure call is not working with "select procedure()" option
Date: 2018-02-20 17:27:08
Message-ID: CAFNULEcgGxams4EMFfyYHTvAeqXP_0p+aGJqmT9CZnon1oEaqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 20, 2018 at 10:45 PM, Alban Hertroys <haramrae(at)gmail(dot)com> wrote:

>
> > On 20 Feb 2018, at 8:13, Abhra Kar <abhra(dot)kar(at)gmail(dot)com> wrote:
> >
> > Hi ,
> > I have a stored procedure name "procedure()". Which I am
> calling by --
> >
> > Session sess = (Session)entityManager.getDelegate(); //entityManager is
> javax.persistent.EntityManager[ Properly Initialise]
> > sess.createSQLQuery("select procedure()");
>
> …
>
> > It's not throwing any exception but not executing the procedure.Using
> oracle query -- sess.createSQLQuery("{ call procedure()
> }").executeUpdate(); procedure execution is working fine.
>
> Seems to me you are forgetting to execute the query, like in your Oracle
> example. IIRC, calling execute() is how to execute a statement that returns
> a ResultSet in Java.
>
> Alban Hertroys
> --
> If you can't see the forest for the trees,
> cut the trees and you'll find there is no forest.
>
>
So What should be the query ---
sess.createSQLQuery("select procedure()").execute();

Something like this?

Thanks
Abhra

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2018-02-20 17:50:35 Re: Performance issues during backup
Previous Message yeli 2018-02-20 17:26:56 Crear Una FUNTION usando ROW_NUMBER