From: | "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp> |
---|---|
To: | "Jarmo Paavilainen" <netletter(at)comder(dot)com> |
Cc: | <pgsql-general(at)hub(dot)org> |
Subject: | RE: Updating cursors |
Date: | 2000-09-04 09:11:52 |
Message-ID: | 000801c01650$2a152f00$2801007e@tpf.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Hiroshi Inoue | 2000-09-04 09:16:45 | RE: subselect in CHECK constraint? |
Previous Message | Jarmo Paavilainen | 2000-09-04 07:20:10 | Updating cursors |