Thema: Delphi SQL ReplaceString

Einzelnen Beitrag anzeigen

danten

Registriert seit: 19. Feb 2012
Ort: Czech Republic, Prag
126 Beiträge
 
Delphi 10.1 Berlin Architect
 
#1

SQL ReplaceString

  Alt 3. Aug 2014, 18:08
Datenbank: Absolute Database • Version: 1 • Zugriff über: 1
Hi all.
How to write a SQL query to change the text in a table recursively?
Here is the code for an operation with a database table:
Delphi-Quellcode:
try
    tab_1.First;
  while not tab_1.Eof do
  begin
    with tab_1 do
    begin
      Edit;
      Application.ProcessMessages;
      Fieldbyname('URL').value := StringReplace(Fieldbyname('URL').AsString,'.','',[rfReplaceAll, rfIgnoreCase]);
      Fieldbyname('URL').value := StringReplace(Fieldbyname('URL').AsString,'/','-',[rfReplaceAll, rfIgnoreCase]);
      Fieldbyname('TEXT').value := StringReplace(tab_2.Fieldbyname('TEXT').AsString,'=','',[rfReplaceAll, rfIgnoreCase]);

      Application.ProcessMessages;
      Post;
    end;
      tab_1.Next;
    end;

  finally
    frm_convert.Caption := 'PtoP => Done';
  end;
Thank you very much in advance.
Daniel
  Mit Zitat antworten Zitat