Updating cursors

Поиск
Список
Период
Сортировка
От Jarmo Paavilainen
Тема Updating cursors
Дата
Msg-id 000701c01640$8f706640$1501a8c0@theboss.comder.private
обсуждение исходный текст
Ответы RE: Updating cursors
Re: Updating cursors
Список pgsql-general
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 ...

int i = GetRowId( ); // C function that reads a unique row id.
ExecuteSQL( "UPDATE myTable SET myColumn = 'myValue' WHERE @ROWID = %d",
i );
ExecuteSQL( "DELETE myTable WHERE @ROWID = %d", i );
// ExecuteSQL(...) is a C function that parses and executes the string.

// Jarmo

PS. I hope Im sending this mail to the right address, if not Im sorry DS.


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