[Lazarus] Não encontra o parametro?
William Oliveira Ferreira
bdexterholland at gmail.com
Mon Mar 3 21:13:05 CET 2014
Exactly Flávio. That ':' shouldn't be there...
Thanks...
Em 3 de março de 2014 17:10, Flávio Etrusco <flavio.etrusco at gmail.com>escreveu:
> 2014-03-03 16:58 GMT-03:00 William Oliveira Ferreira <
> bdexterholland at gmail.com>:
> > Olá lista,
> >
> > eu tenho um código mamão com açúcar aqui que eu não consigo entender por
> que
> > cargas d'água não encontra o parâmetro da SQL. Alguém quer chutar algo?
> >
> > var
> > sql_Query : TSQLQuery;
> > begin
> > Result := False;
> > sql_Query := TSQLQuery.Create(nil);
> > sql_Query.DataBase := Self._Conexao;
> > sql_Query.Transaction := TSQLTransaction(Self._Conexao.Transaction);
> >
> > sql_Query.SQL.Clear;
> > if TSQLTransaction(Self._Conexao.Transaction).Active then
> > TSQLTransaction(Self._Conexao.Transaction).EndTransaction;
> >
> > sql_Query.SQL.Add('DELETE FROM loc_clientes');
> > sql_Query.SQL.Add('WHERE cli_codigo = :PCodigo');
> >
> > sql_Query.ParamByName(':PCodigo').AsInteger := Codigo;
> >
> > try
> > sql_Query.ExecSQL;
> > except
> > raise Exception.Create('Erro ao excluir o cliente! [ID: ' +
> > IntToStr(Codigo) + ']');
> > end;
> >
> > ____
> >
> > A mensagem de erro:
> >
> > Parameter ":PCodigo" not found
> >
> >
> > Vira e mexe esta mensagem me assombra...
> >
> >
> > ...Digo isto porque em outros trechos não ocorre.
> >
> > --
>
> I believe ':' isn't part of the parameter name? (i.e. you're not
> supposed to include it when invoking ParamByName).
>
> Regards,
> Flávio
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
________________________________
William de Oliveira Ferreira
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140303/aaf259df/attachment-0003.html>
More information about the Lazarus
mailing list