Re: CallableStatements

From: Stuart Robinson <stuart(at)zapata(dot)org>
To: Rene Pijlman <rene(at)lab(dot)applinet(dot)nl>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: CallableStatements
Date: 2001-11-26 20:14:32
Message-ID: Pine.LNX.4.30.0111261207350.22398-100000@dreamingamerica.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

There are various circumstances where you might want to call a stored
procedure with an executeUpdate method. For example, let's suppose you
have a view that combines a couple of tables and you want an application
you're building to be able to write to it. Since views are read-only, you
would create a rule that intercepts the inserts and updates and fires off
a stored procedure instead. Since the application is doing an insert or an
update, it will use executeUpdate, but the stored procedure will have to
use select and return a result, causing the application to error out.

-Stuart

On Mon, 26 Nov 2001, Rene Pijlman wrote:

> On Mon, 26 Nov 2001 10:40:52 -0800 (PST), you wrote:
> >But if you use the executeUpdate method, you'll get an error, because it
> >isn't expecting a result, no? So, how do you call a stored procedure using
> >executeUpdate?
>
> You don't. In the current implementation you need to use a
> SELECT statement. Why is that a problem?
>
> Regards,
> René Pijlman <rene(at)lab(dot)applinet(dot)nl>
>

--
Stuart Robinson [stuart(at)zapata(dot)org]
http://www.nerdindustries.com
http://www.tzeltal.org

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2001-11-26 20:27:58 Re: [Fwd: Re: Problems with truncated BLOB]
Previous Message Bruce Momjian 2001-11-26 20:13:36 Re: JDBC bug?