Subject Re: [firebird-support] Re: UPDATE question
Author James N Hitz
And in IbObjects (IBO) there is a RowsAffected property for both
TIB_Statement and TIBODataset objects. In the example using TIB_Cursor
(a descendant):

var rows_affected: integer;
begin
cur.IB_Connection.Close;
cur.SQL.Text := 'delete from contacts where cid = :cid'; //enter
this in design code and prepare for better performance
cur.ParamByName('cid').AsInteger := StrToInt(edtCID.Text);
cur.IB_Connection.Open;
cur.Execute;
rows_affected := cur.RowsAffected;
ShowMessage('You have sucessfully deleted ' +
IntToStr(rows_affected) + ' contact(s)');
cur.IB_Connection.Close;
end;

...of course you would have to wrap this inside a try...except..end
block, with transactions.... just another way of skinning a cat.

giannifilippone wrote:
> with ZEOS components ?? ---->>>>>
>
> ydm.zquery.active:=false;;
> ydm.zquery.SQL.Clear;
> ydm.zquery.SQL.Add('update diario');
> ydm.zquery.SQL.Add('set modo = 2, ');
> ydm.zquery.SQL.Add('data_ora_fine = :adesso');
> ydm.zquery.SQL.Add('where (utente = :key_user) and');
> ydm.zquery.SQL.Add(' (ditta = :key_ditta) and');
> ydm.zquery.SQL.Add(' (amministrazione= :key_amm) and');
> ydm.zquery.SQL.Add(' (progr = :key_progr)');
> ydm.zquery.ParambyName('key_user').AsString := key_user;
> ydm.zquery.ParambyName('key_ditta').Asinteger := key_ditta;
> ydm.zquery.ParambyName('key_amm').Asinteger := key_amm;
> ydm.zquery.ParambyName('key_progr').Asinteger := key_progr;
> ydm.zquery.ParambyName('adesso').Asdatetime := now;
> ydm.zquery.ExecSql;
> k99:= ydm.zquery.RowsAffected; <<<<<<<<<----------------
> <<<<<<<<<<<<
> if (k99 <> 1) then
> MessageBox(Handle,
> pchar('MODIFICATI N° '+INTTOSTR(K99)+ ' records'),
> 'records Modificati - !!! avvisare',
> mb_Ok or mb_IconExclamation or mb_DefButton1)
>
> regards,
> Gianni Filippini
>
>
>
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>