#1 2018-10-10 12:53:31

Shadownildo
Member
From: Brazil
Registered: 2018-10-10
Posts: 36

UPDATE on TSQLRECORD Field

Hello there, i am having a problem in performing the Update command to update the ID of a TSQLRecord field in specific,

this is part of the code
//////////////////////////////////////////////////////////////////////////////////////////////////

  Ambiente := TSQLAmbiente.CreateJoined(FmORMot, ID);
  try
      Ambiente.Database := DataBase;
      Ambiente.DatabaseLOG := DatabaseLog;
      Ambiente.User := UserName;
      Ambiente.Password := Password;
      Ambiente.ServerCharSet := ''
      Ambiente.Sldialect := 3;
      Ambiente.HostName := Host;
      Ambiente.TipoBancoDados := '';
      Ambiente.WaitOnLocks := False;
      Ambiente.Port := Port;
      Ambiente.PortHttp := PortHTTP;
      Ambiente.PortmORMot := PortmORMot;
      Ambiente.Version.IDValue := IDVersion;
      FmORMot.Update(Ambiente);
  except
     raise Exception.Create('Não foi possivel Editar!');
    end;


////////////////////////////////////////////////////////////////
The Update command changes the other fields, but this Version field is a TSQLRECORD, it receives the correct value of the ID, but in Update and Commit, the value saved in the database is a gigantic that does not match the value received.
i Already read all the documentation about Update command and can't found the answer. How i change the TSQLRecord field?

Offline

#2 2018-10-10 13:14:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,258
Website

Re: UPDATE on TSQLRECORD Field

It is not supported in nested fields IIRC.
You have to update the field itself.
Try

 FmORMot.Update(Ambiente.Version);

Offline

#3 2018-10-10 13:35:16

Shadownildo
Member
From: Brazil
Registered: 2018-10-10
Posts: 36

Re: UPDATE on TSQLRECORD Field

ab wrote:

It is not supported in nested fields IIRC.
You have to update the field itself.
Try

 FmORMot.Update(Ambiente.Version);

We already try this, but in the end, When he updates, in the database he comes empty. We Try every single Command in the Documentation about Update, but don't work.

we already  found one solution but, it's change the TSQLRecord field  to a Integer and Relate the tables in the in the Create, but i don't think this is the best solution.

Offline

Board footer

Powered by FluxBB