<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pt-BR">
	<id>https://wiki.sigewin.com.br/index.php?action=history&amp;feed=atom&amp;title=Sql_id</id>
	<title>Sql id - Histórico de revisão</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sigewin.com.br/index.php?action=history&amp;feed=atom&amp;title=Sql_id"/>
	<link rel="alternate" type="text/html" href="https://wiki.sigewin.com.br/index.php?title=Sql_id&amp;action=history"/>
	<updated>2026-04-18T00:20:11Z</updated>
	<subtitle>Histórico de revisões para esta página neste wiki</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://wiki.sigewin.com.br/index.php?title=Sql_id&amp;diff=818&amp;oldid=prev</id>
		<title>FariaMateus: 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...'</title>
		<link rel="alternate" type="text/html" href="https://wiki.sigewin.com.br/index.php?title=Sql_id&amp;diff=818&amp;oldid=prev"/>
		<updated>2022-12-13T12:00:02Z</updated>

		<summary type="html">&lt;p&gt;Criou página com &amp;#039;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...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;execute block as&lt;br /&gt;
declare variable vCaixa double precision;&lt;br /&gt;
declare variable vMov double precision;&lt;br /&gt;
begin&lt;br /&gt;
for select (select max(id_caixa) from vd_caixa cx where mv.DATA between cx.dt_abertura and cx.dt_fechamento), mv.id_movimento&lt;br /&gt;
from fn_movimento mv&lt;br /&gt;
where mv.id_caixa is null&lt;br /&gt;
into :vCaixa, :vMov do&lt;br /&gt;
begin&lt;br /&gt;
update fn_movimento set id_caixa = :vCaixa where id_movimento = :vMov;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
for select (select max(id_caixa) from vd_caixa cx where r.DATA between cx.dt_abertura and cx.dt_fechamento),&lt;br /&gt;
              r.id_recebto&lt;br /&gt;
      from fn_recebeto r &lt;br /&gt;
      where r.id_caixa is null&lt;br /&gt;
  into :vCaixa, :vMov do&lt;br /&gt;
  begin&lt;br /&gt;
    update fn_recebeto set id_caixa = :vCaixa where id_recebto = :vMov;&lt;br /&gt;
  end&lt;br /&gt;
for select (select max(id_caixa) from vd_caixa cx where vd.dt_fechamento between cx.dt_abertura and cx.dt_fechamento),&lt;br /&gt;
              vd.id_pedido &lt;br /&gt;
      from vd_pedido vd&lt;br /&gt;
      where id_caixa is null&lt;br /&gt;
  into :vCaixa, :vMov do&lt;br /&gt;
  begin&lt;br /&gt;
    update vd_pedido set id_caixa = :vCaixa where id_pedido = :vMov;&lt;br /&gt;
  end&lt;br /&gt;
for select (select max(id_caixa) from vd_caixa cx where ch.vencimento between cx.dt_abertura and cx.dt_fechamento),&lt;br /&gt;
              ch.id_cheque &lt;br /&gt;
      from fn_cheque ch&lt;br /&gt;
      where ch.id_caixa is null&lt;br /&gt;
  into :vCaixa, :vMov do&lt;br /&gt;
  begin&lt;br /&gt;
    update fn_cheque set id_caixa = :vCaixa where id_cheque = :vMov;&lt;br /&gt;
  end&lt;br /&gt;
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),&lt;br /&gt;
              ci.id_cartao_itens &lt;br /&gt;
      from fn_cartao_itens ci&lt;br /&gt;
      where id_caixa is null  &lt;br /&gt;
  into :vCaixa, :vMov do&lt;br /&gt;
  begin&lt;br /&gt;
    update fn_cartao_itens set id_caixa = :vCaixa where id_cartao_itens = :vMov;&lt;br /&gt;
  end&lt;br /&gt;
for select (select max(id_caixa) from vd_caixa cx where pb.data between cx.dt_abertura and cx.dt_fechamento),&lt;br /&gt;
               pb.id_pagbaixa &lt;br /&gt;
      from fn_pagbaixa pb&lt;br /&gt;
      where id_caixa is null  &lt;br /&gt;
  into :vCaixa, :vMov do&lt;br /&gt;
  begin&lt;br /&gt;
    update fn_pagbaixa set id_caixa = :vCaixa where id_pagbaixa = :vMov;&lt;br /&gt;
  end&lt;br /&gt;
for select (select max(id_caixa) from vd_caixa cx where pg.data between cx.dt_abertura and cx.dt_fechamento),&lt;br /&gt;
              pg.id_pagamento &lt;br /&gt;
      from fn_pagamento pg&lt;br /&gt;
      where id_caixa is null&lt;br /&gt;
  into :vCaixa, :vMov do&lt;br /&gt;
  begin&lt;br /&gt;
    update fn_pagamento set id_caixa = :vCaixa where id_pagamento = :vMov;&lt;br /&gt;
  end&lt;br /&gt;
for select (select max(id_caixa) from vd_caixa cx where dv.data between cx.dt_abertura and cx.dt_fechamento),&lt;br /&gt;
              dv.id_devolucao &lt;br /&gt;
      from vd_devolucao dv&lt;br /&gt;
      where id_caixa is null&lt;br /&gt;
  into :vCaixa, :vMov do&lt;br /&gt;
  begin&lt;br /&gt;
    update vd_devolucao set id_caixa = :vCaixa where id_devolucao = :vMov;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>FariaMateus</name></author>
	</entry>
</feed>