RE: Updating cursors
| От | Hiroshi Inoue |
|---|---|
| Тема | RE: Updating cursors |
| Дата | |
| Msg-id | 000801c01650$2a152f00$2801007e@tpf.co.jp обсуждение исходный текст |
| Ответ на | Updating cursors ("Jarmo Paavilainen" <netletter@comder.com>) |
| Список | pgsql-general |
> -----Original Message-----
> From: Jarmo Paavilainen
>
> Hi,
>
> Ive a SELECT cursor which I want to update/delete but postgresql does not
> support these:
>
> UPDATE myTable SET myColumn = 'myValue' WHERE CURRENT OF myCursor
> DELETE myTable WHERE CURRENT OF myCursor
>
> Does there exist any workaround?
> Or is my syntax wrong?
>
> One workaround would be to get the row id and to be able to update it.
> Something like this:
>
> ... a row is selected and fetched ...
>
You may be able to use CTID.
You could get CTIDs by using SELECT statements like
select CTID,* from myTable;
and update using CTID
update myTable set ..=.. where CTID=..;
Note that CTIDs aren't of int type.
Regards.
Hiroshi Inoue
В списке pgsql-general по дате отправления: