Re: CallableStatements - Mailing list pgsql-jdbc

From Stuart Robinson
Subject Re: CallableStatements
Date
Msg-id Pine.LNX.4.30.0111261207350.22398-100000@dreamingamerica.com
Whole thread Raw
In response to Re: CallableStatements  (Rene Pijlman <rene@lab.applinet.nl>)
List 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@lab.applinet.nl>
>

--
Stuart Robinson  [stuart@zapata.org]
http://www.nerdindustries.com
http://www.tzeltal.org


pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: [Fwd: Re: Problems with truncated BLOB]
Next
From: "Colin Freas"
Date:
Subject: Re: JDBC bug?