AD (728x60)

Tecnologia do Blogger.

Followers

Total de visualizações

sexta-feira, 20 de dezembro de 2013

Input parameter mismatch for procedure INV_GERA

Erro no método AbreFonteDados. Mensagem = Dynamic SQL Error
Input parameter mismatch for procedure INV_GERA








Após clicar em 'ok' aparecerá o erro:
Programador : dataset não retornado ou método não definido: O método "AbreFonteDados" deve ser definido em
FrmRelContInv (C:\Projetos\dlls\moduloRelatorio\src\relatorios\frmpRel.pas, line 667








Acesse o IBExpert e crie essa procedure no CTRL+F12:


SET TERM ^ ;

ALTER PROCEDURE INV_GERA (
    empresa integer,
    grupo integer,
    tipomerc char(1),
    inativa char(1),
    gerainventario char(1),
    dataref date,
    subgrupo integer)
returns (
    emp integer,
    codgru integer,
    nomegrupo varchar(35),
    prod integer,
    nomeprod varchar(40),
    unid char(2),
    local integer,
    nomelocal varchar(30),
    tipom char(1),
    inat char(1),
    estatu double precision,
    codsgr integer,
    nomesgr varchar(30))
as
declare variable ponto integer;
declare variable tanque integer;
declare variable datahoje date;
begin
  if (:gerainventario is null) then
    gerainventario = 'S';

  if (:subgrupo is null) then
    subgrupo = 0;

  datahoje = cast('today' as date);
  if (:dataref is null) then
      dataref = :datahoje;
  if (:dataref = :datahoje) then
    dataref = cast('now' as timestamp);

  if ((:tipomerc = 'C') and (:gerainventario <> 'N')) then
  begin
    grupo = null;
    delete from a02ainv where invemp = :empresa and invtipo = 'C' ;
  end

  if ((:grupo is not null) and (:subgrupo > 0)) then
  begin
    for select mecod from a02amerc where megru = :grupo and mesgru = :subgrupo
    into :prod
    do begin
      if (:gerainventario <> 'N') then
        delete from a02ainv where invemp = :empresa and invcodm = :prod;
    end
  end

  /* Somente Grupo */
  if (((:grupo is not null) and (:subgrupo = 0)) and (:gerainventario <> 'N')) then
  begin
    delete from a02ainv where invemp = :empresa
    and invgru = :grupo;
  end

  /* Tudo */
  if (((:grupo is null) and (:tipomerc <> 'C')) and (:gerainventario <> 'N')) then
    delete from a02ainv where invemp = :empresa;

  FOR
    SELECT p.meemp, p.mecod, m.metipo, m.menome,
        m.megru, g.gmngru, m.meinativo, m.meun,
        m.mesgru, s.sgnsgr from a02apre P
    LEFT join a02amerc m on m.mecod = p.mecod
    LEFT join a02agrm  g on g.gmgru = m.megru
    LEFT join a02asgp s on s.sggru = m.megru and s.sgsgru = m.mesgru
    where p.meemp = :empresa
       and ((m.megru = :grupo) or (m.metipo = :tipomerc) or (:tipomerc = 'T'))
       and ((m.meinativo = :inativa) or (:inativa is null))
       and ((m.mesgru = :subgrupo) or (:subgrupo = 0))
    order by m.megru, m.menome
    into :emp, :prod, :tipom, :nomeprod, :codgru, :nomegrupo, :inat, :unid,
        :codsgr, :nomesgr
    do begin
       for
       select saldo, local, nomelocal from saldo_estoque(:emp, :prod, :dataref) sd
       where sd.prod = sd.prodatu
       into :estatu, :local, :nomelocal
       do begin
          ponto = :local;
          tanque = null;
          if (:tipom = 'C') then
          begin
            tanque = :local;
            ponto = null;
          end
          if (:gerainventario <> 'N') then
          insert into a02ainv (invemp, invcodm, invponto, invtanque, investatu, invdtest, invgru, invtipo)
          values (:emp, :prod, :ponto, :tanque, :estatu, :dataref, :codgru, :tipom);
          suspend;
       end
    end
end^

SET TERM ; ^


GRANT SELECT,INSERT,DELETE ON A02AINV TO PROCEDURE INV_GERA;
GRANT SELECT ON A02AMERC TO PROCEDURE INV_GERA;
GRANT SELECT ON A02APRE TO PROCEDURE INV_GERA;
GRANT SELECT ON A02AGRM TO PROCEDURE INV_GERA;
GRANT SELECT ON A02ASGP TO PROCEDURE INV_GERA;
GRANT EXECUTE ON PROCEDURE SALDO_ESTOQUE TO PROCEDURE INV_GERA;

Após criar a SQL, gere o relatório novamente.
Tags: , , ,

Postado por

Um novo sistema que auxilia técnicos da SoftPlus a executarem um trabalho mais rápido e fácil. Desenvolvido e alimentado pelos próprios técnicos.

0 comentários:

Postar um comentário

 

Mais Vistos

Adicionados Recentes

Copyright © SoftFácil | Desenvolvido por Rahel William