7.2 behavior -- inserts, rules and jdbc

Поиск
Список
Период
Сортировка
От Richard Welty
Тема 7.2 behavior -- inserts, rules and jdbc
Дата
Msg-id E18dVHz-000672-00@skipper.averillpark.net
обсуждение исходный текст
Список pgsql-jdbc
first, the context: redhat 7.3, postgres 7.2.5, appropriate pgjdbc2.jar

i recently added a rule associated with a table insert. the rule calls a
stored pl/pgsql procedure to update another table in the database. i
couldn't find a way for the procedure to be called unless it returned a
value, so i declared it as returning int and return 1 every time.

the rule is as follows:

CREATE RULE OnPayment AS
ON INSERT TO payment
DO SELECT ApplyPayment ( new.customer_id,
                         new.against_credit_balance,
                         new.payment_type,
                         new.amount,
                         new.operator_id
                        );

so everything works now, _but_: if i use executeUpdate to issue my insert,
i get an SQL exception because a result is returned from ApplyPayment().
i ended up using executeQuery and ignoring the result set instead.

is this really the correct behavior, or have i missed something obvious?

thanks,
  richard
--
Richard Welty                                         rwelty@averillpark.net
Averill Park Networking                                         518-573-7592
              Unix, Linux, IP Network Engineering, Security

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

Предыдущее
От: Achilleus Mantzios
Дата:
Сообщение: Re: 7.3.1 UTF-8 bug(?) and 7.2.x Charset compatibility
Следующее
От: Tony Grant
Дата:
Сообщение: where to put postgresql.jar in Mac OS X