Query.sql= ' Select A,b,c,d,e from a,b,c where ... ';
Source 3 Tables,
Add field list at design time with Origin property for each field
is the A.A,B.B,C.C format, which indicates that the field is the table.
Then query.edit,query.post the method call, when the update or INSERT statement is generated,
UPDATE TTDB.DBO.A
SET [A.A] = @P1
WHERE [A.A] = @P2
and [a.b] = @p3
SQL Server error, prompt
MSG 207, Level 16, State 1, line 3rd
Column name ' A.A is not valid.
Database field must exist, just add [] do not recognize, remove [] do not error, plus [] field name [a] is identifiable, such as
[table1.a],[t1.b],[t1.c]; This is the existence of an unrecognized column. t1.a,t1.b,t1.c this is recognizable. The statement generated by the previous paragraph FIREDAC automatically added [] cannot be removed.
In the Source\data\firedac\firedac.dapt.pas file,
ArUpdate:Result.CommandText: = ocmdgen.generateupdate;
Is the method in the FireDAC.Phys.SQLGenerator.pas file, Getwhere method, GetColumn and Normalizecolname method Most added [], temporarily can not find where to go. Fgenoptions also has no place to assign calls, so abandon this idea.
Query has the Updateoptions>updatetablename property set to the name of the table to be updated, and then the origin prefix of each field is removed so that the resulting UPDATE statement has only the column name and no prefix [field]; try.
SELECT [FieldName] FROM table//column exists
Select Table1.fieldname from table//column exists
SELECT [Table1.fieldname] FROM table//column does not exist.
Fdquery the problem of generating SQL statements with multiple table updates