I have 2 fdb databases company.fdb
and timeAtt.fdb
company.fdb
contains staffDetail
table
staffId - 001
staffName - Andy
staffStatus - Active
timeAtt.fdb
contains staffAtt
table
staffId - 001
staffName - Andy
timeIn - 07:30
timeOut - 04:30
LI - X (late in)
AB - X (absent )
remarks - Emergency leave
Now, i would like to view the staff who was absent only which i did it this way
SELECT staffId,staffName,remarks FROM timeAtt.fdb WHERE AB = 'X'
But the problem is, the query also display inactive staff. So i need to join staffAtt
from timeAtt.fdb
and staffDetail
from company.fdb
to display only staff with active status. How can i do that?
You can't. In Firebird you can only join tables in the same database file. Firebird 2.5 expanded EXECUTE STATEMENT
to also execute a statement on an external datasource, but having a single query reference tables in different databases is not possible.
You have the following options: