FireDac GetFieldNames 不带引号

FireDac GetFieldNames without quotes

我正在通过 Firedac Connection 通过 GetFieldNames 命令行恢复 Firebird 表的字段,但是一些列表字段返回时带有引号。

我试过将参数插入 MetaDefCatalog = MySql 指令,但没有解决。

List:=TStringList.Create;
FDConnection.GetFieldNames('','','Table','',List);
if List.IndexOf('Field') > 0 then
// commands to create field in the table

问题是,当该字段被 Firedac 引号填充时(DBExpress 没有这样做),如果要求子句创建已经存在的字段并生成错误。

GetFieldNames 的结果:

要删除引号,您可以像这样使用StringReplace函数。

FDConnection.GetFieldNames('','','Table','',List);
//remove the quotation marks
List.Text := StringReplace(List.Text, '"', '', [rfReplaceAll]);
if List.IndexOf('Field') > 0 then
 // commands to create field in the table