Mudanças entre as edições de "Sql id"
(Criou página com 'execute block as declare variable vCaixa double precision; declare variable vMov double precision; begin for select (select max(id_caixa) from vd_caixa cx where mv.DATA betwee...') |
(Sem diferença)
|
Edição atual tal como às 12h00min de 13 de dezembro de 2022
execute block as declare variable vCaixa double precision; declare variable vMov double precision; begin for select (select max(id_caixa) from vd_caixa cx where mv.DATA between cx.dt_abertura and cx.dt_fechamento), mv.id_movimento from fn_movimento mv where mv.id_caixa is null into :vCaixa, :vMov do begin update fn_movimento set id_caixa = :vCaixa where id_movimento = :vMov; end
for select (select max(id_caixa) from vd_caixa cx where r.DATA between cx.dt_abertura and cx.dt_fechamento),
r.id_recebto
from fn_recebeto r
where r.id_caixa is null
into :vCaixa, :vMov do
begin
update fn_recebeto set id_caixa = :vCaixa where id_recebto = :vMov;
end
for select (select max(id_caixa) from vd_caixa cx where vd.dt_fechamento between cx.dt_abertura and cx.dt_fechamento),
vd.id_pedido
from vd_pedido vd
where id_caixa is null
into :vCaixa, :vMov do
begin
update vd_pedido set id_caixa = :vCaixa where id_pedido = :vMov;
end
for select (select max(id_caixa) from vd_caixa cx where ch.vencimento between cx.dt_abertura and cx.dt_fechamento),
ch.id_cheque
from fn_cheque ch
where ch.id_caixa is null
into :vCaixa, :vMov do
begin
update fn_cheque set id_caixa = :vCaixa where id_cheque = :vMov;
end
for select (select max(id_caixa) from vd_caixa cx where coalesce(ci.dt_pagto, ci.dt_vencto) between cx.dt_abertura and cx.dt_fechamento),
ci.id_cartao_itens
from fn_cartao_itens ci
where id_caixa is null
into :vCaixa, :vMov do
begin
update fn_cartao_itens set id_caixa = :vCaixa where id_cartao_itens = :vMov;
end
for select (select max(id_caixa) from vd_caixa cx where pb.data between cx.dt_abertura and cx.dt_fechamento),
pb.id_pagbaixa
from fn_pagbaixa pb
where id_caixa is null
into :vCaixa, :vMov do
begin
update fn_pagbaixa set id_caixa = :vCaixa where id_pagbaixa = :vMov;
end
for select (select max(id_caixa) from vd_caixa cx where pg.data between cx.dt_abertura and cx.dt_fechamento),
pg.id_pagamento
from fn_pagamento pg
where id_caixa is null
into :vCaixa, :vMov do
begin
update fn_pagamento set id_caixa = :vCaixa where id_pagamento = :vMov;
end
for select (select max(id_caixa) from vd_caixa cx where dv.data between cx.dt_abertura and cx.dt_fechamento),
dv.id_devolucao
from vd_devolucao dv
where id_caixa is null
into :vCaixa, :vMov do
begin
update vd_devolucao set id_caixa = :vCaixa where id_devolucao = :vMov;
end
end