#1 2020-06-01 14:56:30

Flashcqxg
Member
Registered: 2018-01-11
Posts: 31

TSynDBDataSet:How to update data when there is an alias field ?

My code:
var
  props: TSQLDBWinHTTPConnectionProperties;
  SQL: TStringBuilder;
begin
  props := TSQLDBWinHTTPConnectionProperties.Create('127.0.0.1', 'XXX', '123', '123');
  SQL := TStringBuilder.Create;
  DD := TSynDBDataSet.Create(self);
  DD.Connection := props;
  SQL.Append('SELECT XGSTUFSID,XM,').AppendLine;
  SQL.Append('CASE WHEN SUBSTRING(BKZYDM,3,1) IN(''5'',''6'') THEN ''2'' ELSE ''1'' END LX').AppendLine;
  SQL.Append('FROM BBK').AppendLine;
  DD.CommandText := SQL.ToString;
  DD.Open;

When I modify the field of XM,and call Post and ApplyUpdates(0),but no data was saved.
How can i do ?Thanks.

Offline

#2 2020-06-01 15:26:41

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

Re: TSynDBDataSet:How to update data when there is an alias field ?

Updates are not supported.

Offline

#3 2020-06-02 01:00:27

Flashcqxg
Member
Registered: 2018-01-11
Posts: 31

Re: TSynDBDataSet:How to update data when there is an alias field ?

Thanks,ab.

Offline

Board footer

Powered by FluxBB