Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Firebird, InterBase [игнор отключен] [закрыт для гостей] / select for update / 5 сообщений из 5, страница 1 из 1
05.05.2004, 10:21
    #32506920
Dmitry Klykoff
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
select for update
Хочу в процедуре делать апдейт поля, использую конструкцию:

for select field1 from table1 for update of field1 into :tmpVar do
begin

end;

Какой конструкцией затем апдетйтить поле?
...
Рейтинг: 0 / 0
05.05.2004, 10:38
    #32506948
Dnico
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
select for update
Обычной !

UPDATE TABLE SET ...

Best regards,
Dnico.
...
Рейтинг: 0 / 0
05.05.2004, 10:54
    #32506988
Dmitry Klykoff
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
select for update
простой update обновит мне всю таблицу, а мне надо изменить поле в текущей записи, выбранной курсором (у меня же для этого курсор делается).
Зачем нужна конструкция where current of и как ей пользоваться? что-то я примеров не найду...
...
Рейтинг: 0 / 0
05.05.2004, 11:04
    #32507010
Dnico
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
select for update
Так это же связано только с блокировкой ...

автор(1.5) Explicit locking
Nickolay Samofatov
The addition of the optional WITH LOCK clause provides a limited explicit pessimistic locking capability
for cautious use in conditions where the affected row set is a) extremely small (ideally, a singleton)
and b) precisely controlled by the application code.
NOTE The need for a pessimistic lock in Firebird is very rare indeed and should be well understood
before use of this extension is considered.
Syntax
SELECT ... FROM <sometable>
[WHERE ...]
[FOR UPDATE [OF ...]]
[WITH LOCK]
...;
If the WITH LOCK clause succeeds, it will secure a lock on the selected rows and prevent any other
transaction from obtaining write access to any of those rows, or their dependants, until your
transaction ends.
If the FOR UPDATE clause is included, the lock will be applied to each row, one by one, as it is fetched
into the server-side row cache. It becomes possible, then, that a lock which appeared to succeed
when requested will nevertheless fail subsequently, when an attempt is made to fetch a row which
becomes locked by another transaction.


Best regards,
Dnico.
...
Рейтинг: 0 / 0
05.05.2004, 12:07
    #32507170
Мимопроходящий
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
select for update
2 Dmitry Klykoff :
Смотри сюда . Там показано как.
...
Рейтинг: 0 / 0
Форумы / Firebird, InterBase [игнор отключен] [закрыт для гостей] / select for update / 5 сообщений из 5, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]