GARANTIR DESCONTO

Fórum Update no IB #178488

29/08/2003

0

Pessoal, to dando um updata numa tabela IB e gostaria de saber se ta certo:
os campos sao dos tipos:
Quant=> Numeric(6,2)
Comentario=>Blob -Memo
Descricao=>Char(100)
Data=>TimeStamp

Coloquei o DefaultAction do IBtrans como TACommitRetaining

try
DT.IBTran.StartTransaction;
DT.IBQPerGunta.Sql.Clear;
DT.IBQPerGunta.SQL.Add( ´UPDATE PERGFEM SET ´ );
DT.IBQPerGunta.Sql.Add(´QUANT=´+CEquant.value);
DT.IBQPerGunta.Sql.Add(´COMENTARIO=´+MemoComent.text);
DT.IBQPerGunta.Sql.Add(´DESCRICAO=´+QuotedStr(EdObs.Text));
DT.IBQPerGunta.Sql.Add(´DATA=´+Dtobs.date);

DT.IBTrans.Commit;
except
DT.IBTrans.Rollback;
end;

Ta certo os comandos e o Commit ?

Obrigado


M@rcelo

M@rcelo

Responder

Posts

29/08/2003

Ricardo Barbosa

Olá Marcelo como vai...
O Código está legal, mas só uma perguntinha... Vc não deveria dar um comando de execução para o IBQPergunta

Por Exemplo IBQPergunta.OPEN;
???


Fiz algumas alterações. Veja se funciona

OBS: Se eu não errei a sintaxe de nenhum comando deve ser isso

try
DT.IBTran.StartTransaction;
DT.IBQPerGunta.Sql.Clear;
DT.IBQPerGunta.SQL.Add( ´UPDATE PERGFEM SET ´ );
DT.IBQPerGunta.Sql.Add(´QUANT=:Qtde);
DT.IBQPerGunta.Sql.Add(´COMENTARIO=:Comentario);
DT.IBQPerGunta.Sql.Add(´DESCRICAO=:Descricao);
DT.IBQPerGunta.Sql.Add(´DATA=:Data);



IBQPergunta.ParamByName(´Qtde´).asInteger:=CEquant.value;
IBQPergunta.ParamByName(´Comentario´).AsString:=MemoComent.text;
IBQPergunta.ParamByName(´Descricao´).AsString:=QuotedStr(EdObs.Text);

IBQPergunta.ParamByName(´Data´).AsDate:=Dtobs.date;

DT.IBQPerGunta.Open;
DT.IBTrans.Commit;
except
DT.IBTrans.Rollback;
end;


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar