Нужно выполнить в SQL запросе что-то вроде
update from SPSTEP, STEPDOC, BASEDOC where (SPSTEP.CSTEPDOC = STEPDOC.NREC) and
(STEPDOC.CBASEDOC = BASEDOC.NREC) and
(BASEDOC.DIRECT = 1) and
(SPSTEP.PRMC = 2) and
((SPSTEP.CMCUSL = 400195FCC06367B7h) or
(SPSTEP.CMCUSL = 0000000000000027h) or
(SPSTEP.CMCUSL = 4001BDDBF47D32D8h)) and (BASEDOC.DFORM >= '01/03/2005')
set SPSTEP.WMCPROP := 1;
сделано по аналогии с SELECT, но суппорт на такую формулировку ругается.
Как сделать UPDATE с условием по нескольким таблицам
Модераторы: m0p3e, edward_K, Модераторы
-
- Местный житель
- Сообщения: 228
- Зарегистрирован: 29 мар 2005, 17:49
- Откуда: Москва
- Контактная информация:
Так пробовали
update SPSTEP where (SPSTEP.CSTEPDOC = STEPDOC.NREC) and
(STEPDOC.CBASEDOC = BASEDOC.NREC) and
(BASEDOC.DIRECT = 1) and
(SPSTEP.PRMC = 2) and
((SPSTEP.CMCUSL = 400195FCC06367B7h) or
(SPSTEP.CMCUSL = 0000000000000027h) or
(SPSTEP.CMCUSL = 4001BDDBF47D32D8h)) and (BASEDOC.DFORM >= '01/03/2005')
set WMCPROP := 1;
update SPSTEP where (SPSTEP.CSTEPDOC = STEPDOC.NREC) and
(STEPDOC.CBASEDOC = BASEDOC.NREC) and
(BASEDOC.DIRECT = 1) and
(SPSTEP.PRMC = 2) and
((SPSTEP.CMCUSL = 400195FCC06367B7h) or
(SPSTEP.CMCUSL = 0000000000000027h) or
(SPSTEP.CMCUSL = 4001BDDBF47D32D8h)) and (BASEDOC.DFORM >= '01/03/2005')
set WMCPROP := 1;
попробуйте:oiko писал(а): update SPSTEP where (SPSTEP.CSTEPDOC = STEPDOC.NREC) and
(STEPDOC.CBASEDOC = BASEDOC.NREC) and
(BASEDOC.DIRECT = 1) and
(SPSTEP.PRMC = 2) and
((SPSTEP.CMCUSL = 400195FCC06367B7h) or
(SPSTEP.CMCUSL = 0000000000000027h) or
(SPSTEP.CMCUSL = 4001BDDBF47D32D8h)) and (BASEDOC.DFORM >= '01/03/2005')
set WMCPROP := 1;
update SPSTEP where
((
SPSTEP.CSTEPDOC == STEPDOC.NREC and
STEPDOC.CBASEDOC == BASEDOC.NREC
))
and
(BASEDOC.DIRECT = 1) and
(BASEDOC.DFORM >= '01/03/2005') and
(SPSTEP.PRMC = 2) and
(
(SPSTEP.CMCUSL = 400195FCC06367B7h) or
(SPSTEP.CMCUSL = 0000000000000027h) or
(SPSTEP.CMCUSL = 4001BDDBF47D32D8h)
)
set spstep.WMCPROP := 1;
Не сильно изменила, но все же...