Registriert seit: 29. Dez 2006
Ort: NRW
844 Beiträge
Delphi 10.4 Sydney
|
AW: Mehrfach Update STatement
5. Jul 2019, 16:01
Ich habe es jetzt so:
Delphi-Quellcode:
update as400 set
sequence = case
when (concat(waaunr,'-',waaupo) ='408216-0' and oaagnr =10) then '1'
when (concat(waaunr,'-',waaupo) ='408217-0' and oaagnr =10) then '2'
when (concat(waaunr,'-',waaupo) ='408218-0' and oaagnr =10) then '3'
end,
frozen = case
when (concat(waaunr,'-',waaupo) ='408216-0' and oaagnr =10) then '1'
when (concat(waaunr,'-',waaupo) ='408217-0' and oaagnr =10) then '1'
when (concat(waaunr,'-',waaupo) ='408218-0' and oaagnr =10) then '0'
end,
plan_date = case
when (concat(waaunr,'-',waaupo) ='408216-0' and oaagnr =10) then '2019-07-05'
when (concat(waaunr,'-',waaupo) ='408217-0' and oaagnr =10) then '2019-07-05'
when (concat(waaunr,'-',waaupo) ='408218-0' and oaagnr =10) then '2019-07-06'
end
where concat(waaunr,'-',waaupo) in ('408216-0', '408217-0', '408218-0')
und so versucht
Delphi-Quellcode:
update as400 set
sequence = case
when (concat(waaunr,'-',waaupo) ='408216-0' and oaagnr =10) then 1
when (concat(waaunr,'-',waaupo) ='408217-0' and oaagnr =10) then 2
when (concat(waaunr,'-',waaupo) ='408218-0' and oaagnr =10) then 3
end,
frozen = case
when (concat(waaunr,'-',waaupo) ='408216-0' and oaagnr =10) then 1
when (concat(waaunr,'-',waaupo) ='408217-0' and oaagnr =10) then 1
when (concat(waaunr,'-',waaupo) ='408218-0' and oaagnr =10) then 0
end,
plan_date = case
when (concat(waaunr,'-',waaupo) ='408216-0' and oaagnr =10) then '2019-07-05'
when (concat(waaunr,'-',waaupo) ='408217-0' and oaagnr =10) then '2019-07-05'
when (concat(waaunr,'-',waaupo) ='408218-0' and oaagnr =10) then '2019-07-06'
end
where concat(waaunr,'-',waaupo) in ('408216-0', '408217-0', '408218-0')
und so
Delphi-Quellcode:
update as400 set
sequence = case
when concat(waaunr,'-',waaupo) ='408216-0' and oaagnr =10 then 1
when concat(waaunr,'-',waaupo) ='408217-0' and oaagnr =10 then 2
when concat(waaunr,'-',waaupo) ='408218-0' and oaagnr =10 then 3
end,
frozen = case
when concat(waaunr,'-',waaupo) ='408216-0' and oaagnr =10 then 1
when concat(waaunr,'-',waaupo) ='408217-0' and oaagnr =10 then 1
when concat(waaunr,'-',waaupo) ='408218-0' and oaagnr =10 then 0
end,
plan_date = case
when concat(waaunr,'-',waaupo) ='408216-0' and oaagnr =10 then '2019-07-05'
when concat(waaunr,'-',waaupo) ='408217-0' and oaagnr =10 then '2019-07-05'
when concat(waaunr,'-',waaupo) ='408218-0' and oaagnr =10 then '2019-07-06'
end
where concat(waaunr,'-',waaupo) in ('408216-0', '408217-0', '408218-0')
Leider ist die Fehlermeldung immer die gleiche: Column 'sequence' cannot be null
Patrick
|