Duplicate field name: FIELD_1
Posted: 04.06.2020, 09:30
I have a table with a field, named FIELD_1. I join that table on itself:
SQLQuery.SQL.Text := 'SELECT * FROM Table JOIN Table x ON x.ID = Table.Joined';
SQLQuery.Open;
I am greeted with the error:
EDatabaseError was raised while running background operation with the message: SQLQuery: Duplicate field name 'FIELD_1'
Oracle 12.1.0, client version: 19.6.0, database component version: 7.3.0-3ed53109 (7.2 more fixes to the proxy driver. Some enable it to compile on Delphi XE 10.2 again.)
As far as I see Data.DB is creating the fields from FieldDefList (Data.DB.pas, line 12925):
I guess Zeos is NOT appending _1 to the end of the field name when populating this, as it thinks it's already there and is trying to create two fields with the same name.
SQLQuery.SQL.Text := 'SELECT * FROM Table JOIN Table x ON x.ID = Table.Joined';
SQLQuery.Open;
I am greeted with the error:
EDatabaseError was raised while running background operation with the message: SQLQuery: Duplicate field name 'FIELD_1'
Oracle 12.1.0, client version: 19.6.0, database component version: 7.3.0-3ed53109 (7.2 more fixes to the proxy driver. Some enable it to compile on Delphi XE 10.2 again.)
As far as I see Data.DB is creating the fields from FieldDefList (Data.DB.pas, line 12925):
Code: Select all
Field := FieldDef.CreateField(Self, nil, FieldDefList.Strings[I]);