From: Alban Hertroys <haramrae@gmail.com>
To: Abhra Kar <abhra.kar@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: stored procedure call is not working with "select procedure()" option
Date: Tue, 20 Feb 2018 18:15:37 +0100
Message-ID: <80339D2F-3A01-4BA8-B3DF-268CE7D35BB1@gmail.com> (raw)
In-Reply-To: <CAFNULEcotbRuGwe0vKo2fb0_qzp6pcG-BdC1CuvdpJne2cT38Q@mail.gmail.com>
References: <CAFNULEcotbRuGwe0vKo2fb0_qzp6pcG-BdC1CuvdpJne2cT38Q@mail.gmail.com>
> On 20 Feb 2018, at 8:13, Abhra Kar <abhra.kar@gmail.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.
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-general@postgresql.org
Cc: haramrae@gmail.com, abhra.kar@gmail.com
Subject: Re: stored procedure call is not working with "select procedure()" option
In-Reply-To: <80339D2F-3A01-4BA8-B3DF-268CE7D35BB1@gmail.com>
References: <CAFNULEcotbRuGwe0vKo2fb0_qzp6pcG-BdC1CuvdpJne2cT38Q@mail.gmail.com> <80339D2F-3A01-4BA8-B3DF-268CE7D35BB1@gmail.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