Tracking operations

Hi
on server side i've RemoteDBServerBeforeStatement(Sender: TObject; Info: IStatementInfo); event that log me instructions like this :

UPDATE MACCHINE SET INFO_CLI = :TMS_UPDATE_INFO_CLI WHERE (COD_MAC = :TMS_WHERE_COD_MAC)

but i want to have full informations of update and not parameters like :TMS_UPDATE_INFO_CLI or :TMS_WHERE_COD_MAC. Can i do this ?

Bye

what do you mean by "full information of update"?

for example : UPDATE MACCHINE SET INFO_CLI = 'Pippo' WHERE (COD_MAC = 'DP145667')

for log operations i must see 'clear' data !

As stated in documentation: http://www.tmssoftware.biz/business/remotedb/doc/web/server-side-events.html you also have the Params property which allows you to retrieve the values:



for Param in Info.Params do
  Log(Param.ToString);

Wagner how can i declare Param ? if Param:TEnumerable give me an error : [dcc32 Error] d_DM0.pas(582): E2010 Incompatible types: 'System.Generics.Collections.TEnumerable<Aurelius.Drivers.Interfaces.TDBParam>' and 'TDBParam'

Param is of type TDBParam:

var 
  Param: TDBParam;
...
for Param in Info.Params do
  Log(Param.ToString);
``

Excuse me wagner can i have a complete sample to get the value of params :p1 and :w1 of UPDATE MACCHINE SET INFO_CLI = :p1 WHERE (COD_MAC = :w1) , please ?

I dont known how use your code.

Thx

This is one simple example:

procedure TForm1.RemoteDBServer1BeforeStatement(Sender: TObject;
  Info: IStatementInfo);
var
  Param: TDBParam;
begin
  Log(Info.Sql);
  if Info.Params <> nil then
    for Param in Info.Params do
      Log(Param.ToString);
end;

However we detected an issue with current version, Params are not being passed to the event. A fix will be included in next release.

indeed doesn't go, params is not passed !

with new version corrected this problem ?

Yes:
https://download.tmssoftware.com/business/remotedb/doc/web/whats_new.html

1 Like