Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: TFDTable.Exists Bug?



Permlink Replies: 3 - Last Post: Jul 8, 2014 8:49 AM Last Post By: Dmitry Arefiev
Robert Holler

Posts: 6
Registered: 5/26/98
TFDTable.Exists Bug?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 1, 2014 1:45 AM
TFDTable.Exists returns False for existing Tables under Firebird (V2.5) (other DBs not tested).

The problem seems to be, that also the TFDConnection.GetTableNames(CatalogName, SchemaName, 'ARTIKEL', oList, [osMy, osOther]);
fails to retrive the TableName.

Sample Test Case:

procedure Test_FDTable.Exits;
const
TName = 'ARTIKEL';
var
T: TFDTable;
begin
T := TFDTable.Create(nil);
try
T.ConnectionName := ConnectionNameGDB;
T.TableName := TName;
T.Open; // works because ARTIKEL definitly exists!
CheckTrue(T.Exists, 'TFDTable.Exists bug!'); // fails !!!!????
finally
T.Free;
end;
end;
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: TFDTable.Exists Bug?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 2, 2014 4:21 AM   in response to: Robert Holler in response to: Robert Holler
The problem seems to be, that also the TFDConnection.GetTableNames(CatalogName, SchemaName, 'ARTIKEL', oList, [osMy, osOther]);
fails to retrive the TableName.

TFDTable.GetExists is not correct. To make it working replace inside of this method:
      oConn.GetTableNames(CatalogName, SchemaName, TableName, oList,
        [osMy, osOther]);

with:
      oConn.GetFieldNames(CatalogName, SchemaName, TableName, '', oList);


--
With best regards,
Dmitry Arefiev / FireDAC Architect
Robert Holler

Posts: 6
Registered: 5/26/98
Re: TFDTable.Exists Bug?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 8, 2014 5:38 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
thx for the workaround but the problem is that
oConn.GetTableNames(CatalogName, SchemaName, 'ARTIKEL', oList, [osMy, osOther])
does not work and should be fixed.

Regards
Robert
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: TFDTable.Exists Bug?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 8, 2014 8:49 AM   in response to: Robert Holler in response to: Robert Holler
oConn.GetTableNames(CatalogName, SchemaName, 'ARTIKEL', oList, [osMy, osOther])
does not work and should be fixed.

Fixed. Patch posted to attachments:
https://forums.embarcadero.com/thread.jspa?threadID=106863

Still GetExists with GetFieldNames is the correct version.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02