insert/update/delete statements returning a query response

Поиск
Список
Период
Сортировка
От Barry Lind
Тема insert/update/delete statements returning a query response
Дата
Msg-id 3C02ADB1.5090000@xythos.com
обсуждение исходный текст
Ответы Re: insert/update/delete statements returning a query response  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: insert/update/delete statements returning a query response  (Stuart Robinson <stuart@zapata.org>)
Список pgsql-hackers
Is this behavior intended in the backend?  The problem is that when you 
create a rule on an object that calls a stored function and invoke that 
rule on an insert/update/delete statement your insert/update/delete 
statement will now return a query result to the front end over the FE/BE 
protocol.  (I am not sure this is the exact senerio, but something 
similar).  This means that the user now needs to perform a 
executeQuery() call when using these insert/update/delete statements in 
JDBC because the JDBC driver isn't able to accept a query response when 
issuing a insert/update/delete call.

thanks,
--Barry



-------- Original Message --------
Subject: Re: CallableStatements
Date: Mon, 26 Nov 2001 12:14:32 -0800 (PST)
From: Stuart Robinson <stuart@zapata.org>
To: Rene Pijlman <rene@lab.applinet.nl>
CC: <pgsql-jdbc@postgresql.org>

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,
becauseit> >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


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Minor buglet in update...from (I think)
Следующее
От: Bruce Momjian
Дата:
Сообщение: DEBUG lines in server log