Home > Back-end >  Program execution SQL script
Program execution SQL script

Time:10-28

Now through program execute SQL script, specific use ADO controls, has filtered comment statements/*... */and GO, but the statement notes - unable to filter out, such as the following:
[Tcc_Key] [char] (12) COLLATE Chinese_PRC_CI_AS NULL - applicable v5.0.0.0, v5.2.0.0 later.
Above, if -- annotation conforms to separate into a line, there is no problem, can filter out, if it is with the statements on the same line, do not know how to filter out??

CodePudding user response:


Procedure TForm1. Button1Click (Sender: TObject);
Var
LST: TStringList;
S: a string;
I: Integer;
The begin
LST:=TStringList. Create;
LST. LoadFromFile (' C: \ a.t xt);
For I:=0 to LST. Do the Count - 1
The begin
S:=LST [I];
S:=Copy (s, 1, Pos (' - ', s) - 1);
LST: [I]=s;
end;
ShowMessage (LST) Text);
LST. Free;

end;

CodePudding user response:

With regular expressions

CodePudding user response:

reference 1st floor xiaojun5556 response:
procedure TForm1. Button1Click (Sender: TObject);
Var
LST: TStringList;
S: a string;
I: Integer;
The begin
LST:=TStringList. Create;
LST. LoadFromFile (' C: \ a.t xt);
For I:=0 to LST. Do the Count - 1
.


Another kind of circumstance just forget to say:
[Tcc_Key] [chars] (12) COLLATE Chinese_PRC_CI_AS NULL - applicable v5.0.0.0, v5.2.0.0 later [SZBTime] [datetime] NULL,
Above 2 statement, entrained annotation statement - and the way you cannot solve,

CodePudding user response:

Don't filter can perform well
  • Related