[Lazarus] Não encontra o parametro?
William Oliveira Ferreira
bdexterholland at gmail.com
Tue Mar 4 19:38:48 CET 2014
Hi Daniel,
That was exactly the problem. This was already solved.
Thanks for your help.
Em 4 de março de 2014 15:21, Daniel Erles <derles at gmail.com> escreveu:
> Intenta con esta linea:
>
> sql_Query.ParamByName('PCodigo').AsInteger := Codigo;
>
> sin ":"
>
>
>
> 2014-03-03 15:58 GMT-04: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.
>>
>> --
>> ________________________________
>> William de Oliveira Ferreira
>>
>> --
>> _______________________________________________
>> Lazarus mailing list
>> Lazarus at lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>>
>
> --
> _______________________________________________
> 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/20140304/260e1fe0/attachment-0003.html>
More information about the Lazarus
mailing list