ZTable->Filter problesm on PostgreSQL

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

markus
Senior Boarder
Senior Boarder
Posts: 55
Joined: 17.10.2011, 12:43
Location: Piotrków Trybunalski, Poland

ZTable->Filter problesm on PostgreSQL

Postby markus » 15.10.2012, 19:34

Hi,

i've got table structure like this:

Code: Select all

CREATE TABLE customers
(
  id serial,
  type_id integer,
  name text NOT NULL DEFAULT ''::text,
  street text,
  zip text,
  city text,
  phone text,
  email text,
  contact_person text,
  www text,
  last_contact date,
  next_contact date,
  status integer NOT NULL DEFAULT 0,
  CONSTRAINT pkey_customers PRIMARY KEY (id ),
  CONSTRAINT fk_customers__type_id FOREIGN KEY (type_id)
      REFERENCES company_types (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
  OIDS=FALSE
);


i'm referring to this table with ZTable component, but i want to use Filter property on it.

With simple filter like "status=0" it's ok.
But when i try to use more complex filter: "status=0 and last_contact is not null" filter doesn't seem to be changed at all.
Furthermore when i try to apply filter: "status=0 and coalesce(phone,'')<>'' i get error: "Function coalesce was not found".

If You'll need more details about my design or code fragment's i'll be glad to provide them:)

Best regards,
Marek

User avatar
EgonHugeist
Zeos Dev Team
Zeos Dev Team
Posts: 1701
Joined: 31.03.2011, 22:38

Postby EgonHugeist » 16.10.2012, 05:01

markus,

well the issue you have is furthermore a missunderstanding of the TZTable.Filter. Zeos has it's own filter which is faster than database-requests. The function coalesce is an postgresql supported function but zeos is not able to handle stored procedures/functions in his filter (would be an nice feature).

Marek have a look here http://zeos.firmos.at/viewtopic.php?t=3492 . You'll find a ZExpression.pdf which shows you the way you can use the Zeos-Filter. Btw. all Delphi options and much more posibilities are supported.

"status=0 and last_contact is not null"

Well this should be proffed. For this case a testcase would be nice. (Mostly fixing the bug is faster done than building a testcase, Marek). Great would be if you attach a Bugtempate app which you can find in our Zeos-root.
King regards, Michael

You want to help? viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image


Return to “ZeosLib 7.0 Beta Forum”

Who is online

Users browsing this forum: No registered users and 1 guest