Hello I have next error
I have an sql query like this:
SELECT DISTINCT
us.idx_osoby,
us.imie,
us.nazwisko,
us.login,
dz.nazwa as "nazwa_dzialu",
bl.blokada,
bl.idx_device,
ur.nazwa,
ds.idx_strefy1,
ds.idx_strefy2,
ds.idx_strefy3
FROM public.users as us
LEFT JOIN public.dzialy as dz on us.idx_dzialu = dz.idx_dzialu
LEFT JOIN kd.blokowanie as bl on us.idx_osoby = bl.idx_osoby
LEFT JOIN kd.dostep_userow as ds on us.idx_osoby = ds.idx_osoby
LEFT JOIN dev.urzadzenia as ur on bl.idx_device = ur.idx_device
WHERE (us.aktywny = TRUE) and (bl.idx_device = 23) and (bl.blokada = TRUE)
ORDER by us.idx_osoby;
And it's working but I whant to add some filter on this query looking like this:
qrUsers.Filter := (us.aktywny = TRUE) and (bl.idx_device = 23) and (bl.blokada = TRUE) and in SQL it is working but in zeos I have an error like in subject.
I have looking for this error in code and In:
const
{** Defines a list of operators. }
OperatorTokens is no '.' operator I don't know is that a mistake or it should be like this but I have no idea how can I doing my filtering
Unknow symbol "." in filter
Moderators: gto, EgonHugeist, olehs
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Use the field names as they are returned by the query. This means you can't filter by aktywny.
Filters are executed locally and not added to the sql sent to the server. This also means the same amount of data will be retrieved from the server.
When multiple columns have the same name there's automatic naming, depending on the server. So it's always safer to use aliases for these column names. You never know how this automatic naming behavior changes over time.
Mark
Filters are executed locally and not added to the sql sent to the server. This also means the same amount of data will be retrieved from the server.
When multiple columns have the same name there's automatic naming, depending on the server. So it's always safer to use aliases for these column names. You never know how this automatic naming behavior changes over time.
Mark
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
btray77,
It's about specifying the column names to be returned by the database server in the query. Eg. 'select 1 as column1 from dual' makes sure the column returned by the server is named 'column1' in the dataset instead of some randomly generated name.
That way you know in advance which column name can be used inside the filter property of the ZQuery component, because this filter is not passed on to the database but processed inside the zeoslib based client program. So the filter works on column names as seen by the dataset.
Mark
It's about specifying the column names to be returned by the database server in the query. Eg. 'select 1 as column1 from dual' makes sure the column returned by the server is named 'column1' in the dataset instead of some randomly generated name.
That way you know in advance which column name can be used inside the filter property of the ZQuery component, because this filter is not passed on to the database but processed inside the zeoslib based client program. So the filter works on column names as seen by the dataset.
Mark