There is another topic involved:
Queries returning ONE results and queries returning MANY results:
The system has 2 tables, tbeinkommen and tbkupons.
And 3 results to list / edit:
1)
first task: One Query shows many rows of tbeinkommen.
The results are displayed in at DBDynamicGrid.
2)
second task:
ONE row of tbeinkommen is split into many DBEdit fields, which can be edited one by one.
3)
third task:
The tbKupon has a field fk_einkommen, which is a foreign key at id_einkommen.
The second DBDynamicGrid lists the rows of ONE of the fk_einkommen and shows MANY lines of tbkupons.
======================
This is what you see in the above code is the third task: The WHERE is the selection of the specific foreign key.
But out of some reason, task ONE does not work any more, what it did fine already.
Unfortunately it is very likely that they interact anywhere.
But how to find where?
And there is potential for mess, sure:
The primary key for tbeinkommen is used for 3 times: As multy-request, as single-request and as foreign key.
I made 3 separate TBQueries for this reason.
Checked many times for NOT mixing them up, but may be I overlooked anything.
About "hard coded". You mean, that I should not write the code at design time?
There was a very old thread, where I got the hint, that those SQL fields must not left blank.
This was a time of the previous IBX version.
After having clicked on "generate code" that far away day, something worked, although I changed the SQL-text after this as well.
PS:
I found something very strange, what I never have seen before.
You remember my troubles with the database being too slow?
I was given this very line
"select * from RDB$INDICES where RDB$SYSTEM_FLAG = 0"
I have no idea, what it means.
The only thing, I understood, that there must not be inactive indices.
To check this from time to time, i saved the query.
And today I called it again and I saw a strange entry.
Can this be the solution to this thread?
There is an entry for a foreign key, which I do not understand.
I have a lot of foreign keys, but none of them is listed in that way.
I attach you the screenshot as I am quite sure, YOU understand it.